Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid redundant function declarations in gl.c. NFC #21237

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions system/lib/gl/gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
* found in the LICENSE file.
*/

#if GL_ENABLE_GET_PROC_ADDRESS

// GL proc address retrieval

#include <string.h>
#include <stdlib.h>
#include <emscripten.h>
#include <emscripten/html5_webgl.h>

#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>

#ifdef LEGACY_GL_EMULATION

#include <webgl/webgl1_ext.h>

// Define emscripten_ versions of gl functions, to avoid name collisions
Expand Down Expand Up @@ -1569,15 +1574,6 @@ GLAPI void APIENTRY emscripten_glGetObjectParameteriv (GLhandleARB obj, GLenum p
GLAPI void APIENTRY emscripten_glGetInfoLog (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
GLAPI void APIENTRY emscripten_glBindProgram (GLenum target, GLuint program);

#if GL_ENABLE_GET_PROC_ADDRESS

extern void *emscripten_webgl1_get_proc_address(const char *name);
extern void *_webgl1_match_ext_proc_address_without_suffix(const char *name);
extern void *emscripten_webgl2_get_proc_address(const char *name);
extern void *_webgl2_match_ext_proc_address_without_suffix(const char *name);

#ifdef LEGACY_GL_EMULATION

#define RETURN_GL_EMU_FN(functionName) if (!strcmp(name, #functionName)) return emscripten_##functionName;

void* emscripten_legacy_gl_emulation_GetProcAddress(const char *name) {
Expand Down Expand Up @@ -1795,6 +1791,9 @@ for line in open('a').readlines():
}
#endif

void *_webgl1_match_ext_proc_address_without_suffix(const char *name);
void *_webgl2_match_ext_proc_address_without_suffix(const char *name);

// "Sloppy" desktop OpenGL/mobile GLES emulating
// behavior: different functionality is available under
// different vendor suffixes. In emscripten_GetProcAddress()
Expand Down