Skip to content

Commit

Permalink
Avoid redundant function declarations in gl.c. NFC (#21237)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Feb 1, 2024
1 parent 384ab3c commit fe8421d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions system/lib/gl/gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@
* 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>
#include "webgl_internal_funcs.h"

#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 @@ -244,6 +240,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

0 comments on commit fe8421d

Please sign in to comment.