diff --git a/CMakeLists.txt b/CMakeLists.txt index 72377b13..2fa4ad53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -601,6 +601,8 @@ set(GL1-Source ${COMMON_SRC_DIR}/md4.c ) +set(Glad-GLES1-Source ${REF_SRC_DIR}/gl1/glad-gles1/src/glad.c) + set(GL1-Header ${REF_SRC_DIR}/ref_shared.h ${REF_SRC_DIR}/constants/anorms.h @@ -614,6 +616,11 @@ set(GL1-Header ${COMMON_SRC_DIR}/header/shared.h ) +set(Glad-GLES1-Header + ${REF_SRC_DIR}/gl1/glad-gles1/include/glad/glad.h + ${REF_SRC_DIR}/gl1/glad-gles1/include/KHR/khrplatform.h + ) + set(GL3-Source ${REF_SRC_DIR}/gl3/gl3_draw.c ${REF_SRC_DIR}/gl3/gl3_image.c @@ -829,3 +836,24 @@ target_link_libraries(ref_soft ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags}) if(SDL3_SUPPORT) target_link_libraries(ref_soft SDL3::SDL3) endif() + +if(FALSE) + +# Build the GLES1 dynamic library +add_library(ref_gles1 MODULE ${GL1-Source} ${Glad-GLES1-Source} ${GL1-Header} ${Glad-GLES1-Header} ${REF-Platform-Specific-Source}) +set_target_properties(ref_gles1 PROPERTIES + PREFIX "" + #COMPILE_DEFINITIONS "YQ2_GL1_GLES=1" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release + SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX} + ) +target_include_directories(ref_gles1 PRIVATE ${CMAKE_SOURCE_DIR}/src/client/refresh/gl1/glad-gles1/include) +target_compile_definitions(ref_gles1 PRIVATE YQ2_GL1_GLES=1) +target_link_libraries(ref_gles1 ${yquake2LinkerFlags} ${yquake2OpenGLLinkerFlags} + ${yquake2SDLLinkerFlags}) +if(SDL3_SUPPORT) + target_link_libraries(ref_gles1 SDL3::SDL3) +endif() + +endif() \ No newline at end of file diff --git a/Makefile b/Makefile index 898f5623..57c963e9 100644 --- a/Makefile +++ b/Makefile @@ -397,15 +397,20 @@ endif # ---------- # Phony targets -.PHONY : all client game icon server ref_gl1 ref_gl3 ref_gles3 ref_soft +.PHONY : all client game icon server ref_gl1 ref_gl3 ref_gles1 ref_gles3 ref_soft # ---------- -# Builds everything +# Builds everything but the GLES1 renderer all: config client server game ref_gl1 ref_gl3 ref_gles3 ref_soft # ---------- +# Builds everything, including the GLES1 renderer +with_gles1: all ref_gles1 + +# ---------- + # Print config values config: @echo "Build configuration" @@ -622,6 +627,49 @@ build/ref_gl1/%.o: %.c # ---------- +# The OpenGL ES 1.0 renderer lib + +ifeq ($(YQ2_OSTYPE), Windows) + +ref_gles1: + @echo "===> Building ref_gles1.dll" + $(MAKE) release/ref_gles1.dll + +release/ref_gles1.dll : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include +release/ref_gles1.dll : CFLAGS += -DYQ2_GL1_GLES +release/ref_gles1.dll : LDFLAGS += -shared +release/ref_gles1.dll : LDLIBS += -lGLESv2 + +else ifeq ($(YQ2_OSTYPE), Darwin) + +ref_gles1: + @echo "===> Building ref_gles1.dylib" + $(MAKE) release/ref_gles1.dylib + +release/ref_gles1.dylib : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include +release/ref_gles1.dylib : CFLAGS += -DYQ2_GL1_GLES +release/ref_gles1.dylib : LDFLAGS += -shared -framework OpenGL + +else # not Windows or Darwin + +ref_gles1: + @echo "===> Building ref_gles1.so" + $(MAKE) release/ref_gles1.so + +release/ref_gles1.so : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include +release/ref_gles1.so : CFLAGS += -DYQ2_GL1_GLES -fPIC +release/ref_gles1.so : LDFLAGS += -shared +release/ref_gles1.so : LDLIBS += -lGL + +endif # OS specific ref_gles1 stuff + +build/ref_gles1/%.o: %.c + @echo "===> CC $<" + ${Q}mkdir -p $(@D) + ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) $(GLAD_INCLUDE) -o $@ $< + +# ---------- + # The OpenGL 3.x renderer lib ifeq ($(YQ2_OSTYPE), Windows) @@ -969,6 +1017,9 @@ REFGL1_OBJS_ := \ src/common/shared/shared.o \ src/common/md4.o +REFGL1_OBJS_GLADEES_ := \ + src/client/refresh/gl1/glad-gles1/src/glad.o + ifeq ($(YQ2_OSTYPE), Windows) REFGL1_OBJS_ += \ src/backends/windows/shared/hunk.o @@ -1110,6 +1161,8 @@ endif # Rewrite paths to our object directory. CLIENT_OBJS = $(patsubst %,build/client/%,$(CLIENT_OBJS_)) REFGL1_OBJS = $(patsubst %,build/ref_gl1/%,$(REFGL1_OBJS_)) +REFGLES1_OBJS = $(patsubst %,build/ref_gles1/%,$(REFGL1_OBJS_)) +REFGLES1_OBJS += $(patsubst %,build/ref_gles1/%,$(REFGL1_OBJS_GLADEES_)) REFGL3_OBJS = $(patsubst %,build/ref_gl3/%,$(REFGL3_OBJS_)) REFGL3_OBJS += $(patsubst %,build/ref_gl3/%,$(REFGL3_OBJS_GLADE_)) REFGLES3_OBJS = $(patsubst %,build/ref_gles3/%,$(REFGL3_OBJS_)) @@ -1124,6 +1177,7 @@ GAME_OBJS = $(patsubst %,build/baseq2/%,$(GAME_OBJS_)) CLIENT_DEPS= $(CLIENT_OBJS:.o=.d) GAME_DEPS= $(GAME_OBJS:.o=.d) REFGL1_DEPS= $(REFGL1_OBJS:.o=.d) +REFGLES1_DEPS= $(REFGLES1_OBJS:.o=.d) REFGL3_DEPS= $(REFGL3_OBJS:.o=.d) REFGLES3_DEPS= $(REFGLES3_OBJS:.o=.d) REFSOFT_DEPS= $(REFSOFT_OBJS:.o=.d) @@ -1133,6 +1187,7 @@ SERVER_DEPS= $(SERVER_OBJS:.o=.d) -include $(CLIENT_DEPS) -include $(GAME_DEPS) -include $(REFGL1_DEPS) +-include $(REFGLES1_DEPS) -include $(REFGL3_DEPS) -include $(REFGLES3_DEPS) -include $(SERVER_DEPS) @@ -1182,6 +1237,22 @@ release/ref_gl1.so : $(REFGL1_OBJS) ${Q}$(CC) $(LDFLAGS) $(REFGL1_OBJS) $(LDLIBS) $(SDLLDFLAGS) -o $@ endif +# release/ref_gles1.so +ifeq ($(YQ2_OSTYPE), Windows) +release/ref_gles1.dll : $(REFGLES1_OBJS) + @echo "===> LD $@" + ${Q}$(CC) $(LDFLAGS) $(REFGLES1_OBJS) $(LDLIBS) $(DLL_SDLLDFLAGS) -o $@ + $(Q)strip $@ +else ifeq ($(YQ2_OSTYPE), Darwin) +release/ref_gles1.dylib : $(REFGLES1_OBJS) + @echo "===> LD $@" + ${Q}$(CC) $(LDFLAGS) $(REFGLES1_OBJS) $(LDLIBS) $(SDLLDFLAGS) -o $@ +else +release/ref_gles1.so : $(REFGLES1_OBJS) + @echo "===> LD $@" + ${Q}$(CC) $(LDFLAGS) $(REFGLES1_OBJS) $(LDLIBS) $(SDLLDFLAGS) -o $@ +endif + # release/ref_gl3.so ifeq ($(YQ2_OSTYPE), Windows) release/ref_gl3.dll : $(REFGL3_OBJS) diff --git a/doc/020_installation.md b/doc/020_installation.md index 73efe2fb..d3ed83b0 100644 --- a/doc/020_installation.md +++ b/doc/020_installation.md @@ -322,6 +322,10 @@ or *gmake* (FreeBSD, NetBSD, OpenBSD). Note on Solaris systems, *make* After the build finished, copy everything from the *release/* directory to the Yamagi Quake II installation directory. +If you want to generate the OpenGL ES 1.0 renderer, which may be the only +graphics API available on some SoCs (like Raspberry Pi 3 or older), type +*make with_gles1*. + For the addons download or clone their source, change into the source directory and type *make* (Linux, MacOS and Windows) or *gmake* (FreeBSD, NetBSD, OpenBSD). After the compilation finishes the *release/game.so* diff --git a/doc/040_cvarlist.md b/doc/040_cvarlist.md index db4bab1c..6e343476 100644 --- a/doc/040_cvarlist.md +++ b/doc/040_cvarlist.md @@ -8,7 +8,7 @@ have been renamed. The prefixes are: * No prefix: General stuff. * `cl_`: Client. * `gl_`: Common to all OpenGL renderers. -* `gl1_`: OpenGL 1.4 renderer. +* `gl1_`: OpenGL 1.4 and OpenGL ES1 renderers. * `gl3_`: OpenGL 3.2 and OpenGL ES3 renderers. * `ogg_`: Ogg/Vorbis music playback. * `r_`: Common to all renderers. @@ -469,7 +469,7 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable` `GL_NEAREST_MIPMAP_LINEAR`, `GL_LINEAR_MIPMAP_LINEAR` -## Graphics (OpenGL 1.4 only) +## Graphics (OpenGL 1.4 and OpenGL ES1 only) * **gl1_intensity**: Sets the color intensity. Must be a floating point value, at least `1.0` - default is `2.0`. Applied when textures are diff --git a/src/client/menu/videomenu.c b/src/client/menu/videomenu.c index af0f02a2..8d46eed9 100644 --- a/src/client/menu/videomenu.c +++ b/src/client/menu/videomenu.c @@ -72,8 +72,8 @@ static menuaction_s s_apply_action; // -------- -// gl1, gl3, gles3, gl4, vk, soft -#define MAXRENDERERS 6 +// gl1, gl3, gles1, gles3, gl4, vk, soft +#define MAXRENDERERS 7 typedef struct { @@ -96,6 +96,13 @@ Renderer_FillRenderdef(void) rendererlist[numrenderer].cvarstr = "gl1"; } + if (VID_HasRenderer("gles1")) + { + numrenderer++; + rendererlist[numrenderer].boxstr = "[OpenGL ES1]"; + rendererlist[numrenderer].cvarstr = "gles1"; + } + if (VID_HasRenderer("gl3")) { numrenderer++; @@ -188,7 +195,7 @@ static void ApplyFilter(void* unused) { if (Q_stricmp(vid_renderer->string, "gl3") == 0 || Q_stricmp(vid_renderer->string, "gles3") == 0 || - Q_stricmp(vid_renderer->string, "gl1") == 0) + Q_stricmp(vid_renderer->string, "gl1") == 0 || Q_stricmp(vid_renderer->string, "gles1") == 0) { if (s_filter_list.curvalue == 0) { @@ -715,7 +722,7 @@ VID_MenuInit(void) int mode = 0; if (Q_stricmp(vid_renderer->string, "gl3") == 0 || Q_stricmp(vid_renderer->string, "gles3") == 0 || - Q_stricmp(vid_renderer->string, "gl1") == 0) + Q_stricmp(vid_renderer->string, "gl1") == 0 || Q_stricmp(vid_renderer->string, "gles1") == 0) { s_filter_list.generic.x = 0; s_filter_list.generic.y = (y += 10); @@ -789,7 +796,7 @@ VID_MenuInit(void) Menu_AddItem(&s_opengl_menu, (void *)&s_vk_overbrightbits_slider); Menu_AddItem(&s_opengl_menu, (void *)&s_vk_dynamic_list); } - else if (strcmp(vid_renderer->string, "gl1") == 0) + else if (strcmp(vid_renderer->string, "gl1") == 0 || strcmp(vid_renderer->string, "gles1") == 0) { Menu_AddItem(&s_opengl_menu, (void *)&s_gl1_intensity_slider); Menu_AddItem(&s_opengl_menu, (void *)&s_gl1_overbrightbits_slider); @@ -800,7 +807,8 @@ VID_MenuInit(void) Menu_AddItem(&s_opengl_menu, (void *)&s_af_list); Menu_AddItem(&s_opengl_menu, (void *)&s_msaa_list); if (Q_stricmp(vid_renderer->string, "gl3") == 0 || Q_stricmp(vid_renderer->string, "gles3") == 0 || - Q_stricmp(vid_renderer->string, "gl1") == 0 || Q_stricmp(vid_renderer->string, "soft") == 0) + Q_stricmp(vid_renderer->string, "gl1") == 0 || Q_stricmp(vid_renderer->string, "gles1") == 0 || + Q_stricmp(vid_renderer->string, "soft") == 0) { Menu_AddItem(&s_opengl_menu, (void *)&s_filter_list); } diff --git a/src/client/refresh/gl1/gl1_image.c b/src/client/refresh/gl1/gl1_image.c index dd748899..e69ef39f 100644 --- a/src/client/refresh/gl1/gl1_image.c +++ b/src/client/refresh/gl1/gl1_image.c @@ -47,9 +47,17 @@ qboolean R_Upload32(unsigned *data, int width, int height, qboolean mipmap); int gl_solid_format = GL_RGB; int gl_alpha_format = GL_RGBA; -int gl_tex_solid_format = GL_RGB; +#ifdef YQ2_GL1_GLES +#define DEFAULT_SOLID_FORMAT GL_RGBA +#else +#define DEFAULT_SOLID_FORMAT GL_RGB +#endif + +int gl_tex_solid_format = DEFAULT_SOLID_FORMAT; int gl_tex_alpha_format = GL_RGBA; +#undef DEFAULT_SOLID_FORMAT + int gl_filter_min = GL_LINEAR_MIPMAP_NEAREST; int gl_filter_max = GL_LINEAR; @@ -76,6 +84,20 @@ typedef struct int mode; } gltmode_t; +#ifdef YQ2_GL1_GLES + +gltmode_t gl_alpha_modes[] = { + {"default", GL_RGBA}, + {"GL_RGBA", GL_RGBA}, +}; + +gltmode_t gl_solid_modes[] = { + {"default", GL_RGBA}, + {"GL_RGBA", GL_RGBA}, +}; + +#else + gltmode_t gl_alpha_modes[] = { {"default", GL_RGBA}, {"GL_RGBA", GL_RGBA}, @@ -85,8 +107,6 @@ gltmode_t gl_alpha_modes[] = { {"GL_RGBA2", GL_RGBA2}, }; -#define NUM_GL_ALPHA_MODES (sizeof(gl_alpha_modes) / sizeof(gltmode_t)) - gltmode_t gl_solid_modes[] = { {"default", GL_RGB}, {"GL_RGB", GL_RGB}, @@ -96,6 +116,9 @@ gltmode_t gl_solid_modes[] = { {"GL_R3_G3_B2", GL_R3_G3_B2}, }; +#endif + +#define NUM_GL_ALPHA_MODES (sizeof(gl_alpha_modes) / sizeof(gltmode_t)) #define NUM_GL_SOLID_MODES (sizeof(gl_solid_modes) / sizeof(gltmode_t)) typedef struct diff --git a/src/client/refresh/gl1/gl1_main.c b/src/client/refresh/gl1/gl1_main.c index 74aadbee..c9e32345 100644 --- a/src/client/refresh/gl1/gl1_main.c +++ b/src/client/refresh/gl1/gl1_main.c @@ -925,6 +925,7 @@ R_SetGL2D(void) static void R_RenderView(refdef_t *fd) { +#ifndef YQ2_GL1_GLES if ((gl_state.stereo_mode != STEREO_MODE_NONE) && gl_state.camera_separation) { qboolean drawing_left_eye = gl_state.camera_separation < 0; @@ -1032,7 +1033,7 @@ R_RenderView(refdef_t *fd) break; } } - +#endif if (r_norefresh->value) { @@ -1400,6 +1401,13 @@ R_SetMode(void) return true; } +// just to avoid too many preprocessor directives in RI_Init() +typedef enum +{ + rf_opengl14, + rf_opengles10 +} refresher_t; + qboolean RI_Init(void) { @@ -1407,6 +1415,14 @@ RI_Init(void) byte *colormap; extern float r_turbsin[256]; +#ifdef YQ2_GL1_GLES +#define GLEXTENSION_NPOT "GL_OES_texture_npot" + static const refresher_t refresher = rf_opengles10; +#else +#define GLEXTENSION_NPOT "GL_ARB_texture_non_power_of_two" + static const refresher_t refresher = rf_opengl14; +#endif + Swap_Init(); for (j = 0; j < 256; j++) @@ -1462,7 +1478,7 @@ RI_Init(void) sscanf(gl_config.version_string, "%d.%d", &gl_config.major_version, &gl_config.minor_version); - if (gl_config.major_version == 1) + if (refresher == rf_opengl14 && gl_config.major_version == 1) { if (gl_config.minor_version < 4) { @@ -1480,7 +1496,8 @@ RI_Init(void) /* Point parameters */ R_Printf(PRINT_ALL, " - Point parameters: "); - if ( strstr(gl_config.extensions_string, "GL_ARB_point_parameters") || + if ( refresher == rf_opengles10 || + strstr(gl_config.extensions_string, "GL_ARB_point_parameters") || strstr(gl_config.extensions_string, "GL_EXT_point_parameters") ) // should exist for all OGL 1.4 hw... { qglPointParameterf = (void (APIENTRY *)(GLenum, GLfloat))RI_GetProcAddress ( "glPointParameterf" ); @@ -1573,7 +1590,7 @@ RI_Init(void) /* Non power of two textures */ R_Printf(PRINT_ALL, " - Non power of two textures: "); - if (strstr(gl_config.extensions_string, "GL_ARB_texture_non_power_of_two")) + if (strstr(gl_config.extensions_string, GLEXTENSION_NPOT)) { gl_config.npottextures = true; R_Printf(PRINT_ALL, "Okay\n"); @@ -1584,6 +1601,8 @@ RI_Init(void) R_Printf(PRINT_ALL, "Failed\n"); } +#undef GLEXTENSION_NPOT + // ---- /* Multitexturing */ @@ -1591,7 +1610,7 @@ RI_Init(void) R_Printf(PRINT_ALL, " - Multitexturing: "); - if (strstr(gl_config.extensions_string, "GL_ARB_multitexture")) + if ( refresher == rf_opengles10 || strstr(gl_config.extensions_string, "GL_ARB_multitexture") ) { qglActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glActiveTexture"); qglClientActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glClientActiveTexture"); @@ -1780,6 +1799,7 @@ RI_BeginFrame(float camera_separation) gl1_particle_square->modified = false; } +#ifndef YQ2_GL1_GLES /* draw buffer stuff */ if (gl_drawbuffer->modified) { @@ -1797,6 +1817,7 @@ RI_BeginFrame(float camera_separation) } } } +#endif /* texturemode stuff */ if (gl_texturemode->modified || (gl_config.anisotropic && gl_anisotropic->modified) diff --git a/src/client/refresh/gl1/gl1_sdl.c b/src/client/refresh/gl1/gl1_sdl.c index 707b9154..a47e802a 100644 --- a/src/client/refresh/gl1/gl1_sdl.c +++ b/src/client/refresh/gl1/gl1_sdl.c @@ -80,6 +80,7 @@ int RI_PrepareForWindow(void) SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); if (SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8) == 0) { @@ -90,6 +91,12 @@ int RI_PrepareForWindow(void) gl_state.stencil = false; } +#ifdef YQ2_GL1_GLES + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); +#endif + // Let's see if the driver supports MSAA. int msaa_samples = 0; @@ -220,6 +227,21 @@ int RI_InitContext(void* win) return false; } +#ifdef YQ2_GL1_GLES + + // Load GL pointers through GLAD and check context. + if( !gladLoadGLES1Loader(SDL_GL_GetProcAddress)) + { + R_Printf(PRINT_ALL, "RI_InitContext(): ERROR: loading OpenGL ES function pointers failed!\n"); + return false; + } + + gl_config.major_version = GLVersion.major; + gl_config.minor_version = GLVersion.minor; + R_Printf(PRINT_ALL, "Initialized OpenGL ES version %d.%d context\n", gl_config.major_version, gl_config.minor_version); + +#else + // Check if it's really OpenGL 1.4. const char* glver = (char *)glGetString(GL_VERSION); sscanf(glver, "%d.%d", &gl_config.major_version, &gl_config.minor_version); @@ -231,6 +253,8 @@ int RI_InitContext(void* win) return false; } +#endif + // Check if we've got the requested MSAA. int msaa_samples = 0; @@ -262,7 +286,11 @@ int RI_InitContext(void* win) // Window title - set here so we can display renderer name in it. char title[40] = {0}; +#ifdef YQ2_GL1_GLES + snprintf(title, sizeof(title), "Yamagi Quake II %s - OpenGL ES 1.0", YQ2VERSION); +#else snprintf(title, sizeof(title), "Yamagi Quake II %s - OpenGL 1.4", YQ2VERSION); +#endif SDL_SetWindowTitle(window, title); #if SDL_VERSION_ATLEAST(2, 26, 0) diff --git a/src/client/refresh/gl1/gl1_surf.c b/src/client/refresh/gl1/gl1_surf.c index 7e6edfb3..10e0f219 100644 --- a/src/client/refresh/gl1/gl1_surf.c +++ b/src/client/refresh/gl1/gl1_surf.c @@ -604,9 +604,12 @@ static void R_RegenAllLightmaps() { int i, map, smax, tmax, top, bottom, left, right, bt, bb, bl, br; - qboolean affected_lightmap, pixelstore_set = false; msurface_t *surf; byte *base; + qboolean affected_lightmap; +#ifndef YQ2_GL1_GLES + qboolean pixelstore_set = false; +#endif if ( !gl_config.multitexture ) { @@ -672,25 +675,38 @@ R_RegenAllLightmaps() continue; } +#ifndef YQ2_GL1_GLES if (!pixelstore_set) { glPixelStorei(GL_UNPACK_ROW_LENGTH, gl_state.block_width); pixelstore_set = true; } - - base = gl_lms.lightmap_buffer[i]; - base += (bt * gl_state.block_width + bl) * LIGHTMAP_BYTES; +#endif // upload changes + base = gl_lms.lightmap_buffer[i]; + +#ifdef YQ2_GL1_GLES + base += (bt * gl_state.block_width) * LIGHTMAP_BYTES; + + R_Bind(gl_state.lightmap_textures + i); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, bt, gl_state.block_width, bb - bt, + GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE, base); +#else + base += (bt * gl_state.block_width + bl) * LIGHTMAP_BYTES; + R_Bind(gl_state.lightmap_textures + i); glTexSubImage2D(GL_TEXTURE_2D, 0, bl, bt, br - bl, bb - bt, GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE, base); +#endif } +#ifndef YQ2_GL1_GLES if (pixelstore_set) { glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); } +#endif } static void diff --git a/src/client/refresh/gl1/glad-gles1/include/KHR/khrplatform.h b/src/client/refresh/gl1/glad-gles1/include/KHR/khrplatform.h new file mode 100644 index 00000000..01646449 --- /dev/null +++ b/src/client/refresh/gl1/glad-gles1/include/KHR/khrplatform.h @@ -0,0 +1,311 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * The master copy of khrplatform.h is maintained in the Khronos EGL + * Registry repository at https://github.com/KhronosGroup/EGL-Registry + * The last semantic modification to khrplatform.h was at commit ID: + * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by filing pull requests or issues on + * the EGL Registry repository linked above. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 +/* + * To support platform where unsigned long cannot be used interchangeably with + * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. + * Ideally, we could just use (u)intptr_t everywhere, but this could result in + * ABI breakage if khronos_uintptr_t is changed from unsigned long to + * unsigned long long or similar (this results in different C++ name mangling). + * To avoid changes for existing platforms, we restrict usage of intptr_t to + * platforms where the size of a pointer is larger than the size of long. + */ +#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) +#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ +#define KHRONOS_USE_INTPTR_T +#endif +#endif + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef KHRONOS_USE_INTPTR_T +typedef intptr_t khronos_intptr_t; +typedef uintptr_t khronos_uintptr_t; +#elif defined(_WIN64) +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +#endif + +#if defined(_WIN64) +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/src/client/refresh/gl1/glad-gles1/include/glad/glad.h b/src/client/refresh/gl1/glad-gles1/include/glad/glad.h new file mode 100644 index 00000000..b082ac5e --- /dev/null +++ b/src/client/refresh/gl1/glad-gles1/include/glad/glad.h @@ -0,0 +1,1180 @@ +/* + + OpenGL ES loader generated by glad 0.1.36 on Tue Dec 20 14:35:00 2022. + + Language/Generator: C/C++ + Specification: gl + APIs: gles1=1.0 + Profile: core + Extensions: + GL_EXT_debug_marker, + GL_EXT_discard_framebuffer, + GL_EXT_texture_format_BGRA8888, + GL_OES_EGL_image, + GL_OES_EGL_image_external, + GL_OES_compressed_ETC1_RGB8_texture, + GL_OES_compressed_paletted_texture, + GL_OES_depth24, + GL_OES_depth32, + GL_OES_draw_texture, + GL_OES_framebuffer_object, + GL_OES_mapbuffer, + GL_OES_matrix_palette, + GL_OES_query_matrix, + GL_OES_rgb8_rgba8, + GL_OES_stencil8, + GL_OES_texture_npot + Loader: False + Local files: False + Omit khrplatform: False + Reproducible: False + + Commandline: + --profile="core" --api="gles1=1.0" --generator="c" --spec="gl" --no-loader --extensions="GL_EXT_debug_marker,GL_EXT_discard_framebuffer,GL_EXT_texture_format_BGRA8888,GL_OES_EGL_image,GL_OES_EGL_image_external,GL_OES_compressed_ETC1_RGB8_texture,GL_OES_compressed_paletted_texture,GL_OES_depth24,GL_OES_depth32,GL_OES_draw_texture,GL_OES_framebuffer_object,GL_OES_mapbuffer,GL_OES_matrix_palette,GL_OES_query_matrix,GL_OES_rgb8_rgba8,GL_OES_stencil8,GL_OES_texture_npot" + Online: + https://glad.dav1d.de/#profile=core&language=c&specification=gl&api=gles1%3D1.0&extensions=GL_EXT_debug_marker&extensions=GL_EXT_discard_framebuffer&extensions=GL_EXT_texture_format_BGRA8888&extensions=GL_OES_EGL_image&extensions=GL_OES_EGL_image_external&extensions=GL_OES_compressed_ETC1_RGB8_texture&extensions=GL_OES_compressed_paletted_texture&extensions=GL_OES_depth24&extensions=GL_OES_depth32&extensions=GL_OES_draw_texture&extensions=GL_OES_framebuffer_object&extensions=GL_OES_mapbuffer&extensions=GL_OES_matrix_palette&extensions=GL_OES_query_matrix&extensions=GL_OES_rgb8_rgba8&extensions=GL_OES_stencil8&extensions=GL_OES_texture_npot +*/ + + +#ifndef __glad_h_ +#define __glad_h_ + +#ifdef __gl_h_ +#error OpenGL ES 1 header already included, remove this include, glad already provides it +#endif +#define __gl_h_ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define APIENTRY __stdcall +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct gladGLversionStruct { + int major; + int minor; +}; + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(_WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI struct gladGLversionStruct GLVersion; +GLAPI int gladLoadGLES1Loader(GLADloadproc); + +#include +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef khronos_int8_t GLbyte; +typedef khronos_uint8_t GLubyte; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; +typedef int GLint; +typedef unsigned int GLuint; +typedef khronos_int32_t GLclampx; +typedef int GLsizei; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void *GLeglClientBufferEXT; +typedef void *GLeglImageOES; +typedef char GLchar; +typedef char GLcharARB; +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef khronos_uint16_t GLhalf; +typedef khronos_uint16_t GLhalfARB; +typedef khronos_int32_t GLfixed; +typedef khronos_intptr_t GLintptr; +typedef khronos_intptr_t GLintptrARB; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_ssize_t GLsizeiptrARB; +typedef khronos_int64_t GLint64; +typedef khronos_int64_t GLint64EXT; +typedef khronos_uint64_t GLuint64; +typedef khronos_uint64_t GLuint64EXT; +typedef struct __GLsync *GLsync; +struct _cl_context; +struct _cl_event; +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef unsigned short GLhalfNV; +typedef GLintptr GLvdpauSurfaceNV; +typedef void (APIENTRY *GLVULKANPROCNV)(void); +#define GL_VERSION_ES_CL_1_0 1 +#define GL_VERSION_ES_CM_1_1 1 +#define GL_VERSION_ES_CL_1_1 1 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_FOG 0x0B60 +#define GL_LIGHTING 0x0B50 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_BLEND 0x0BE2 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_NORMALIZE 0x0BA1 +#define GL_RESCALE_NORMAL 0x803A +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_LINE_WIDTH 0x0B21 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_SHADE_MODEL 0x0B54 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_FOG_HINT 0x0C54 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_ADD 0x0104 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_SUBTRACT 0x84E7 +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_ALPHA_SCALE 0x0D1C +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#ifndef GL_VERSION_ES_CM_1_0 +#define GL_VERSION_ES_CM_1_0 1 +GLAPI int GLAD_GL_VERSION_ES_CM_1_0; +typedef void (APIENTRYP PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref); +GLAPI PFNGLALPHAFUNCPROC glad_glAlphaFunc; +#define glAlphaFunc glad_glAlphaFunc +typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; +#define glClearColor glad_glClearColor +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); +GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +#define glClearDepthf glad_glClearDepthf +typedef void (APIENTRYP PFNGLCLIPPLANEFPROC)(GLenum p, const GLfloat *eqn); +GLAPI PFNGLCLIPPLANEFPROC glad_glClipPlanef; +#define glClipPlanef glad_glClipPlanef +typedef void (APIENTRYP PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCOLOR4FPROC glad_glColor4f; +#define glColor4f glad_glColor4f +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); +GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +#define glDepthRangef glad_glDepthRangef +typedef void (APIENTRYP PFNGLFOGFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLFOGFPROC glad_glFogf; +#define glFogf glad_glFogf +typedef void (APIENTRYP PFNGLFOGFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLFOGFVPROC glad_glFogfv; +#define glFogfv glad_glFogfv +typedef void (APIENTRYP PFNGLFRUSTUMFPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLFRUSTUMFPROC glad_glFrustumf; +#define glFrustumf glad_glFrustumf +typedef void (APIENTRYP PFNGLGETCLIPPLANEFPROC)(GLenum plane, GLfloat *equation); +GLAPI PFNGLGETCLIPPLANEFPROC glad_glGetClipPlanef; +#define glGetClipPlanef glad_glGetClipPlanef +typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat *data); +GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; +#define glGetFloatv glad_glGetFloatv +typedef void (APIENTRYP PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat *params); +GLAPI PFNGLGETLIGHTFVPROC glad_glGetLightfv; +#define glGetLightfv glad_glGetLightfv +typedef void (APIENTRYP PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat *params); +GLAPI PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +#define glGetMaterialfv glad_glGetMaterialfv +typedef void (APIENTRYP PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +#define glGetTexEnvfv glad_glGetTexEnvfv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +#define glGetTexParameterfv glad_glGetTexParameterfv +typedef void (APIENTRYP PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTMODELFPROC glad_glLightModelf; +#define glLightModelf glad_glLightModelf +typedef void (APIENTRYP PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +#define glLightModelfv glad_glLightModelfv +typedef void (APIENTRYP PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTFPROC glad_glLightf; +#define glLightf glad_glLightf +typedef void (APIENTRYP PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTFVPROC glad_glLightfv; +#define glLightfv glad_glLightfv +typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); +GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; +#define glLineWidth glad_glLineWidth +typedef void (APIENTRYP PFNGLLOADMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +#define glLoadMatrixf glad_glLoadMatrixf +typedef void (APIENTRYP PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param); +GLAPI PFNGLMATERIALFPROC glad_glMaterialf; +#define glMaterialf glad_glMaterialf +typedef void (APIENTRYP PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat *params); +GLAPI PFNGLMATERIALFVPROC glad_glMaterialfv; +#define glMaterialfv glad_glMaterialfv +typedef void (APIENTRYP PFNGLMULTMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +#define glMultMatrixf glad_glMultMatrixf +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +#define glMultiTexCoord4f glad_glMultiTexCoord4f +typedef void (APIENTRYP PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI PFNGLNORMAL3FPROC glad_glNormal3f; +#define glNormal3f glad_glNormal3f +typedef void (APIENTRYP PFNGLORTHOFPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLORTHOFPROC glad_glOrthof; +#define glOrthof glad_glOrthof +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +#define glPointParameterf glad_glPointParameterf +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +#define glPointParameterfv glad_glPointParameterfv +typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); +GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; +#define glPointSize glad_glPointSize +typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +#define glPolygonOffset glad_glPolygonOffset +typedef void (APIENTRYP PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLROTATEFPROC glad_glRotatef; +#define glRotatef glad_glRotatef +typedef void (APIENTRYP PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLSCALEFPROC glad_glScalef; +#define glScalef glad_glScalef +typedef void (APIENTRYP PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXENVFPROC glad_glTexEnvf; +#define glTexEnvf glad_glTexEnvf +typedef void (APIENTRYP PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXENVFVPROC glad_glTexEnvfv; +#define glTexEnvfv glad_glTexEnvfv +typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +#define glTexParameterf glad_glTexParameterf +typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +#define glTexParameterfv glad_glTexParameterfv +typedef void (APIENTRYP PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTRANSLATEFPROC glad_glTranslatef; +#define glTranslatef glad_glTranslatef +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +#define glActiveTexture glad_glActiveTexture +typedef void (APIENTRYP PFNGLALPHAFUNCXPROC)(GLenum func, GLfixed ref); +GLAPI PFNGLALPHAFUNCXPROC glad_glAlphaFuncx; +#define glAlphaFuncx glad_glAlphaFuncx +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; +#define glBindBuffer glad_glBindBuffer +typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; +#define glBindTexture glad_glBindTexture +typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); +GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; +#define glBlendFunc glad_glBlendFunc +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; +#define glBufferData glad_glBufferData +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +#define glBufferSubData glad_glBufferSubData +typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); +GLAPI PFNGLCLEARPROC glad_glClear; +#define glClear glad_glClear +typedef void (APIENTRYP PFNGLCLEARCOLORXPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCLEARCOLORXPROC glad_glClearColorx; +#define glClearColorx glad_glClearColorx +typedef void (APIENTRYP PFNGLCLEARDEPTHXPROC)(GLfixed depth); +GLAPI PFNGLCLEARDEPTHXPROC glad_glClearDepthx; +#define glClearDepthx glad_glClearDepthx +typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); +GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; +#define glClearStencil glad_glClearStencil +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +#define glClientActiveTexture glad_glClientActiveTexture +typedef void (APIENTRYP PFNGLCLIPPLANEXPROC)(GLenum plane, const GLfixed *equation); +GLAPI PFNGLCLIPPLANEXPROC glad_glClipPlanex; +#define glClipPlanex glad_glClipPlanex +typedef void (APIENTRYP PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI PFNGLCOLOR4UBPROC glad_glColor4ub; +#define glColor4ub glad_glColor4ub +typedef void (APIENTRYP PFNGLCOLOR4XPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCOLOR4XPROC glad_glColor4x; +#define glColor4x glad_glColor4x +typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLCOLORMASKPROC glad_glColorMask; +#define glColorMask glad_glColorMask +typedef void (APIENTRYP PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLCOLORPOINTERPROC glad_glColorPointer; +#define glColorPointer glad_glColorPointer +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +#define glCompressedTexImage2D glad_glCompressedTexImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +#define glCopyTexImage2D glad_glCopyTexImage2D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +#define glCopyTexSubImage2D glad_glCopyTexSubImage2D +typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); +GLAPI PFNGLCULLFACEPROC glad_glCullFace; +#define glCullFace glad_glCullFace +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); +GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +#define glDeleteBuffers glad_glDeleteBuffers +typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint *textures); +GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +#define glDeleteTextures glad_glDeleteTextures +typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); +GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; +#define glDepthFunc glad_glDepthFunc +typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); +GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; +#define glDepthMask glad_glDepthMask +typedef void (APIENTRYP PFNGLDEPTHRANGEXPROC)(GLfixed n, GLfixed f); +GLAPI PFNGLDEPTHRANGEXPROC glad_glDepthRangex; +#define glDepthRangex glad_glDepthRangex +typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); +GLAPI PFNGLDISABLEPROC glad_glDisable; +#define glDisable glad_glDisable +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +#define glDisableClientState glad_glDisableClientState +typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; +#define glDrawArrays glad_glDrawArrays +typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; +#define glDrawElements glad_glDrawElements +typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); +GLAPI PFNGLENABLEPROC glad_glEnable; +#define glEnable glad_glEnable +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +#define glEnableClientState glad_glEnableClientState +typedef void (APIENTRYP PFNGLFINISHPROC)(void); +GLAPI PFNGLFINISHPROC glad_glFinish; +#define glFinish glad_glFinish +typedef void (APIENTRYP PFNGLFLUSHPROC)(void); +GLAPI PFNGLFLUSHPROC glad_glFlush; +#define glFlush glad_glFlush +typedef void (APIENTRYP PFNGLFOGXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLFOGXPROC glad_glFogx; +#define glFogx glad_glFogx +typedef void (APIENTRYP PFNGLFOGXVPROC)(GLenum pname, const GLfixed *param); +GLAPI PFNGLFOGXVPROC glad_glFogxv; +#define glFogxv glad_glFogxv +typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); +GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; +#define glFrontFace glad_glFrontFace +typedef void (APIENTRYP PFNGLFRUSTUMXPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLFRUSTUMXPROC glad_glFrustumx; +#define glFrustumx glad_glFrustumx +typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean *data); +GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +#define glGetBooleanv glad_glGetBooleanv +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +#define glGetBufferParameteriv glad_glGetBufferParameteriv +typedef void (APIENTRYP PFNGLGETCLIPPLANEXPROC)(GLenum plane, GLfixed *equation); +GLAPI PFNGLGETCLIPPLANEXPROC glad_glGetClipPlanex; +#define glGetClipPlanex glad_glGetClipPlanex +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); +GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; +#define glGenBuffers glad_glGenBuffers +typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint *textures); +GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; +#define glGenTextures glad_glGenTextures +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(void); +GLAPI PFNGLGETERRORPROC glad_glGetError; +#define glGetError glad_glGetError +typedef void (APIENTRYP PFNGLGETFIXEDVPROC)(GLenum pname, GLfixed *params); +GLAPI PFNGLGETFIXEDVPROC glad_glGetFixedv; +#define glGetFixedv glad_glGetFixedv +typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data); +GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; +#define glGetIntegerv glad_glGetIntegerv +typedef void (APIENTRYP PFNGLGETLIGHTXVPROC)(GLenum light, GLenum pname, GLfixed *params); +GLAPI PFNGLGETLIGHTXVPROC glad_glGetLightxv; +#define glGetLightxv glad_glGetLightxv +typedef void (APIENTRYP PFNGLGETMATERIALXVPROC)(GLenum face, GLenum pname, GLfixed *params); +GLAPI PFNGLGETMATERIALXVPROC glad_glGetMaterialxv; +#define glGetMaterialxv glad_glGetMaterialxv +typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void **params); +GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; +#define glGetPointerv glad_glGetPointerv +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); +GLAPI PFNGLGETSTRINGPROC glad_glGetString; +#define glGetString glad_glGetString +typedef void (APIENTRYP PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +#define glGetTexEnviv glad_glGetTexEnviv +typedef void (APIENTRYP PFNGLGETTEXENVXVPROC)(GLenum target, GLenum pname, GLfixed *params); +GLAPI PFNGLGETTEXENVXVPROC glad_glGetTexEnvxv; +#define glGetTexEnvxv glad_glGetTexEnvxv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +#define glGetTexParameteriv glad_glGetTexParameteriv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVPROC)(GLenum target, GLenum pname, GLfixed *params); +GLAPI PFNGLGETTEXPARAMETERXVPROC glad_glGetTexParameterxv; +#define glGetTexParameterxv glad_glGetTexParameterxv +typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); +GLAPI PFNGLHINTPROC glad_glHint; +#define glHint glad_glHint +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; +#define glIsBuffer glad_glIsBuffer +typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); +GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; +#define glIsEnabled glad_glIsEnabled +typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; +#define glIsTexture glad_glIsTexture +typedef void (APIENTRYP PFNGLLIGHTMODELXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTMODELXPROC glad_glLightModelx; +#define glLightModelx glad_glLightModelx +typedef void (APIENTRYP PFNGLLIGHTMODELXVPROC)(GLenum pname, const GLfixed *param); +GLAPI PFNGLLIGHTMODELXVPROC glad_glLightModelxv; +#define glLightModelxv glad_glLightModelxv +typedef void (APIENTRYP PFNGLLIGHTXPROC)(GLenum light, GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTXPROC glad_glLightx; +#define glLightx glad_glLightx +typedef void (APIENTRYP PFNGLLIGHTXVPROC)(GLenum light, GLenum pname, const GLfixed *params); +GLAPI PFNGLLIGHTXVPROC glad_glLightxv; +#define glLightxv glad_glLightxv +typedef void (APIENTRYP PFNGLLINEWIDTHXPROC)(GLfixed width); +GLAPI PFNGLLINEWIDTHXPROC glad_glLineWidthx; +#define glLineWidthx glad_glLineWidthx +typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(void); +GLAPI PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +#define glLoadIdentity glad_glLoadIdentity +typedef void (APIENTRYP PFNGLLOADMATRIXXPROC)(const GLfixed *m); +GLAPI PFNGLLOADMATRIXXPROC glad_glLoadMatrixx; +#define glLoadMatrixx glad_glLoadMatrixx +typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); +GLAPI PFNGLLOGICOPPROC glad_glLogicOp; +#define glLogicOp glad_glLogicOp +typedef void (APIENTRYP PFNGLMATERIALXPROC)(GLenum face, GLenum pname, GLfixed param); +GLAPI PFNGLMATERIALXPROC glad_glMaterialx; +#define glMaterialx glad_glMaterialx +typedef void (APIENTRYP PFNGLMATERIALXVPROC)(GLenum face, GLenum pname, const GLfixed *param); +GLAPI PFNGLMATERIALXVPROC glad_glMaterialxv; +#define glMaterialxv glad_glMaterialxv +typedef void (APIENTRYP PFNGLMATRIXMODEPROC)(GLenum mode); +GLAPI PFNGLMATRIXMODEPROC glad_glMatrixMode; +#define glMatrixMode glad_glMatrixMode +typedef void (APIENTRYP PFNGLMULTMATRIXXPROC)(const GLfixed *m); +GLAPI PFNGLMULTMATRIXXPROC glad_glMultMatrixx; +#define glMultMatrixx glad_glMultMatrixx +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI PFNGLMULTITEXCOORD4XPROC glad_glMultiTexCoord4x; +#define glMultiTexCoord4x glad_glMultiTexCoord4x +typedef void (APIENTRYP PFNGLNORMAL3XPROC)(GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI PFNGLNORMAL3XPROC glad_glNormal3x; +#define glNormal3x glad_glNormal3x +typedef void (APIENTRYP PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLNORMALPOINTERPROC glad_glNormalPointer; +#define glNormalPointer glad_glNormalPointer +typedef void (APIENTRYP PFNGLORTHOXPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLORTHOXPROC glad_glOrthox; +#define glOrthox glad_glOrthox +typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; +#define glPixelStorei glad_glPixelStorei +typedef void (APIENTRYP PFNGLPOINTPARAMETERXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLPOINTPARAMETERXPROC glad_glPointParameterx; +#define glPointParameterx glad_glPointParameterx +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVPROC)(GLenum pname, const GLfixed *params); +GLAPI PFNGLPOINTPARAMETERXVPROC glad_glPointParameterxv; +#define glPointParameterxv glad_glPointParameterxv +typedef void (APIENTRYP PFNGLPOINTSIZEXPROC)(GLfixed size); +GLAPI PFNGLPOINTSIZEXPROC glad_glPointSizex; +#define glPointSizex glad_glPointSizex +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXPROC)(GLfixed factor, GLfixed units); +GLAPI PFNGLPOLYGONOFFSETXPROC glad_glPolygonOffsetx; +#define glPolygonOffsetx glad_glPolygonOffsetx +typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(void); +GLAPI PFNGLPOPMATRIXPROC glad_glPopMatrix; +#define glPopMatrix glad_glPopMatrix +typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(void); +GLAPI PFNGLPUSHMATRIXPROC glad_glPushMatrix; +#define glPushMatrix glad_glPushMatrix +typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; +#define glReadPixels glad_glReadPixels +typedef void (APIENTRYP PFNGLROTATEXPROC)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLROTATEXPROC glad_glRotatex; +#define glRotatex glad_glRotatex +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +#define glSampleCoverage glad_glSampleCoverage +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEXPROC)(GLclampx value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEXPROC glad_glSampleCoveragex; +#define glSampleCoveragex glad_glSampleCoveragex +typedef void (APIENTRYP PFNGLSCALEXPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLSCALEXPROC glad_glScalex; +#define glScalex glad_glScalex +typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORPROC glad_glScissor; +#define glScissor glad_glScissor +typedef void (APIENTRYP PFNGLSHADEMODELPROC)(GLenum mode); +GLAPI PFNGLSHADEMODELPROC glad_glShadeModel; +#define glShadeModel glad_glShadeModel +typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; +#define glStencilFunc glad_glStencilFunc +typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); +GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; +#define glStencilMask glad_glStencilMask +typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); +GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; +#define glStencilOp glad_glStencilOp +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +#define glTexCoordPointer glad_glTexCoordPointer +typedef void (APIENTRYP PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXENVIPROC glad_glTexEnvi; +#define glTexEnvi glad_glTexEnvi +typedef void (APIENTRYP PFNGLTEXENVXPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXENVXPROC glad_glTexEnvx; +#define glTexEnvx glad_glTexEnvx +typedef void (APIENTRYP PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXENVIVPROC glad_glTexEnviv; +#define glTexEnviv glad_glTexEnviv +typedef void (APIENTRYP PFNGLTEXENVXVPROC)(GLenum target, GLenum pname, const GLfixed *params); +GLAPI PFNGLTEXENVXVPROC glad_glTexEnvxv; +#define glTexEnvxv glad_glTexEnvxv +typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +#define glTexImage2D glad_glTexImage2D +typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +#define glTexParameteri glad_glTexParameteri +typedef void (APIENTRYP PFNGLTEXPARAMETERXPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXPARAMETERXPROC glad_glTexParameterx; +#define glTexParameterx glad_glTexParameterx +typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +#define glTexParameteriv glad_glTexParameteriv +typedef void (APIENTRYP PFNGLTEXPARAMETERXVPROC)(GLenum target, GLenum pname, const GLfixed *params); +GLAPI PFNGLTEXPARAMETERXVPROC glad_glTexParameterxv; +#define glTexParameterxv glad_glTexParameterxv +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +#define glTexSubImage2D glad_glTexSubImage2D +typedef void (APIENTRYP PFNGLTRANSLATEXPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLTRANSLATEXPROC glad_glTranslatex; +#define glTranslatex glad_glTranslatex +typedef void (APIENTRYP PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +#define glVertexPointer glad_glVertexPointer +typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLVIEWPORTPROC glad_glViewport; +#define glViewport glad_glViewport +#endif +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#define GL_BGRA_EXT 0x80E1 +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_ETC1_RGB8_OES 0x8D64 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#define GL_NONE_OES 0 +#define GL_FRAMEBUFFER_OES 0x8D40 +#define GL_RENDERBUFFER_OES 0x8D41 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_RENDERBUFFER_WIDTH_OES 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 +#define GL_COLOR_ATTACHMENT0_OES 0x8CE0 +#define GL_DEPTH_ATTACHMENT_OES 0x8D00 +#define GL_STENCIL_ATTACHMENT_OES 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA +#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD +#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 +#define GL_RENDERBUFFER_BINDING_OES 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#define GL_MAX_VERTEX_UNITS_OES 0x86A4 +#define GL_MAX_PALETTE_MATRICES_OES 0x8842 +#define GL_MATRIX_PALETTE_OES 0x8840 +#define GL_MATRIX_INDEX_ARRAY_OES 0x8844 +#define GL_WEIGHT_ARRAY_OES 0x86AD +#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843 +#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 +#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E +#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB +#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA +#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#define GL_STENCIL_INDEX8_OES 0x8D48 +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +GLAPI int GLAD_GL_EXT_debug_marker; +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC)(GLsizei length, const GLchar *marker); +GLAPI PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; +#define glInsertEventMarkerEXT glad_glInsertEventMarkerEXT +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC)(GLsizei length, const GLchar *marker); +GLAPI PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; +#define glPushGroupMarkerEXT glad_glPushGroupMarkerEXT +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC)(void); +GLAPI PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; +#define glPopGroupMarkerEXT glad_glPopGroupMarkerEXT +#endif +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +GLAPI int GLAD_GL_EXT_discard_framebuffer; +typedef void (APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC)(GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI PFNGLDISCARDFRAMEBUFFEREXTPROC glad_glDiscardFramebufferEXT; +#define glDiscardFramebufferEXT glad_glDiscardFramebufferEXT +#endif +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +GLAPI int GLAD_GL_EXT_texture_format_BGRA8888; +#endif +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +GLAPI int GLAD_GL_OES_EGL_image; +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target, GLeglImageOES image); +GLAPI PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glad_glEGLImageTargetTexture2DOES; +#define glEGLImageTargetTexture2DOES glad_glEGLImageTargetTexture2DOES +typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC)(GLenum target, GLeglImageOES image); +GLAPI PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glad_glEGLImageTargetRenderbufferStorageOES; +#define glEGLImageTargetRenderbufferStorageOES glad_glEGLImageTargetRenderbufferStorageOES +#endif +#ifndef GL_OES_EGL_image_external +#define GL_OES_EGL_image_external 1 +GLAPI int GLAD_GL_OES_EGL_image_external; +#endif +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +GLAPI int GLAD_GL_OES_compressed_ETC1_RGB8_texture; +#endif +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +GLAPI int GLAD_GL_OES_compressed_paletted_texture; +#endif +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +GLAPI int GLAD_GL_OES_depth24; +#endif +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +GLAPI int GLAD_GL_OES_depth32; +#endif +#ifndef GL_OES_draw_texture +#define GL_OES_draw_texture 1 +GLAPI int GLAD_GL_OES_draw_texture; +typedef void (APIENTRYP PFNGLDRAWTEXSOESPROC)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +GLAPI PFNGLDRAWTEXSOESPROC glad_glDrawTexsOES; +#define glDrawTexsOES glad_glDrawTexsOES +typedef void (APIENTRYP PFNGLDRAWTEXIOESPROC)(GLint x, GLint y, GLint z, GLint width, GLint height); +GLAPI PFNGLDRAWTEXIOESPROC glad_glDrawTexiOES; +#define glDrawTexiOES glad_glDrawTexiOES +typedef void (APIENTRYP PFNGLDRAWTEXXOESPROC)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +GLAPI PFNGLDRAWTEXXOESPROC glad_glDrawTexxOES; +#define glDrawTexxOES glad_glDrawTexxOES +typedef void (APIENTRYP PFNGLDRAWTEXSVOESPROC)(const GLshort *coords); +GLAPI PFNGLDRAWTEXSVOESPROC glad_glDrawTexsvOES; +#define glDrawTexsvOES glad_glDrawTexsvOES +typedef void (APIENTRYP PFNGLDRAWTEXIVOESPROC)(const GLint *coords); +GLAPI PFNGLDRAWTEXIVOESPROC glad_glDrawTexivOES; +#define glDrawTexivOES glad_glDrawTexivOES +typedef void (APIENTRYP PFNGLDRAWTEXXVOESPROC)(const GLfixed *coords); +GLAPI PFNGLDRAWTEXXVOESPROC glad_glDrawTexxvOES; +#define glDrawTexxvOES glad_glDrawTexxvOES +typedef void (APIENTRYP PFNGLDRAWTEXFOESPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +GLAPI PFNGLDRAWTEXFOESPROC glad_glDrawTexfOES; +#define glDrawTexfOES glad_glDrawTexfOES +typedef void (APIENTRYP PFNGLDRAWTEXFVOESPROC)(const GLfloat *coords); +GLAPI PFNGLDRAWTEXFVOESPROC glad_glDrawTexfvOES; +#define glDrawTexfvOES glad_glDrawTexfvOES +#endif +#ifndef GL_OES_framebuffer_object +#define GL_OES_framebuffer_object 1 +GLAPI int GLAD_GL_OES_framebuffer_object; +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEROESPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFEROESPROC glad_glIsRenderbufferOES; +#define glIsRenderbufferOES glad_glIsRenderbufferOES +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEROESPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFEROESPROC glad_glBindRenderbufferOES; +#define glBindRenderbufferOES glad_glBindRenderbufferOES +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC)(GLsizei n, const GLuint *renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSOESPROC glad_glDeleteRenderbuffersOES; +#define glDeleteRenderbuffersOES glad_glDeleteRenderbuffersOES +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSOESPROC)(GLsizei n, GLuint *renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSOESPROC glad_glGenRenderbuffersOES; +#define glGenRenderbuffersOES glad_glGenRenderbuffersOES +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEOESPROC glad_glRenderbufferStorageOES; +#define glRenderbufferStorageOES glad_glRenderbufferStorageOES +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVOESPROC glad_glGetRenderbufferParameterivOES; +#define glGetRenderbufferParameterivOES glad_glGetRenderbufferParameterivOES +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEROESPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFEROESPROC glad_glIsFramebufferOES; +#define glIsFramebufferOES glad_glIsFramebufferOES +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFEROESPROC glad_glBindFramebufferOES; +#define glBindFramebufferOES glad_glBindFramebufferOES +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC)(GLsizei n, const GLuint *framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSOESPROC glad_glDeleteFramebuffersOES; +#define glDeleteFramebuffersOES glad_glDeleteFramebuffersOES +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC)(GLsizei n, GLuint *framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSOESPROC glad_glGenFramebuffersOES; +#define glGenFramebuffersOES glad_glGenFramebuffersOES +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSOESPROC glad_glCheckFramebufferStatusOES; +#define glCheckFramebufferStatusOES glad_glCheckFramebufferStatusOES +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFEROESPROC glad_glFramebufferRenderbufferOES; +#define glFramebufferRenderbufferOES glad_glFramebufferRenderbufferOES +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DOESPROC glad_glFramebufferTexture2DOES; +#define glFramebufferTexture2DOES glad_glFramebufferTexture2DOES +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC)(GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC glad_glGetFramebufferAttachmentParameterivOES; +#define glGetFramebufferAttachmentParameterivOES glad_glGetFramebufferAttachmentParameterivOES +typedef void (APIENTRYP PFNGLGENERATEMIPMAPOESPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPOESPROC glad_glGenerateMipmapOES; +#define glGenerateMipmapOES glad_glGenerateMipmapOES +#endif +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +GLAPI int GLAD_GL_OES_mapbuffer; +typedef void * (APIENTRYP PFNGLMAPBUFFEROESPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFEROESPROC glad_glMapBufferOES; +#define glMapBufferOES glad_glMapBufferOES +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFEROESPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFEROESPROC glad_glUnmapBufferOES; +#define glUnmapBufferOES glad_glUnmapBufferOES +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC)(GLenum target, GLenum pname, void **params); +GLAPI PFNGLGETBUFFERPOINTERVOESPROC glad_glGetBufferPointervOES; +#define glGetBufferPointervOES glad_glGetBufferPointervOES +#endif +#ifndef GL_OES_matrix_palette +#define GL_OES_matrix_palette 1 +GLAPI int GLAD_GL_OES_matrix_palette; +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC)(GLuint matrixpaletteindex); +GLAPI PFNGLCURRENTPALETTEMATRIXOESPROC glad_glCurrentPaletteMatrixOES; +#define glCurrentPaletteMatrixOES glad_glCurrentPaletteMatrixOES +typedef void (APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC)(void); +GLAPI PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC glad_glLoadPaletteFromModelViewMatrixOES; +#define glLoadPaletteFromModelViewMatrixOES glad_glLoadPaletteFromModelViewMatrixOES +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLMATRIXINDEXPOINTEROESPROC glad_glMatrixIndexPointerOES; +#define glMatrixIndexPointerOES glad_glMatrixIndexPointerOES +typedef void (APIENTRYP PFNGLWEIGHTPOINTEROESPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLWEIGHTPOINTEROESPROC glad_glWeightPointerOES; +#define glWeightPointerOES glad_glWeightPointerOES +#endif +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +GLAPI int GLAD_GL_OES_query_matrix; +typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC)(GLfixed *mantissa, GLint *exponent); +GLAPI PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; +#define glQueryMatrixxOES glad_glQueryMatrixxOES +#endif +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +GLAPI int GLAD_GL_OES_rgb8_rgba8; +#endif +#ifndef GL_OES_stencil8 +#define GL_OES_stencil8 1 +GLAPI int GLAD_GL_OES_stencil8; +#endif +#ifndef GL_OES_texture_npot +#define GL_OES_texture_npot 1 +GLAPI int GLAD_GL_OES_texture_npot; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/client/refresh/gl1/glad-gles1/src/glad.c b/src/client/refresh/gl1/glad-gles1/src/glad.c new file mode 100644 index 00000000..4588d479 --- /dev/null +++ b/src/client/refresh/gl1/glad-gles1/src/glad.c @@ -0,0 +1,634 @@ +/* + + OpenGL ES loader generated by glad 0.1.36 on Tue Dec 20 14:35:00 2022. + + Language/Generator: C/C++ + Specification: gl + APIs: gles1=1.0 + Profile: core + Extensions: + GL_EXT_debug_marker, + GL_EXT_discard_framebuffer, + GL_EXT_texture_format_BGRA8888, + GL_OES_EGL_image, + GL_OES_EGL_image_external, + GL_OES_compressed_ETC1_RGB8_texture, + GL_OES_compressed_paletted_texture, + GL_OES_depth24, + GL_OES_depth32, + GL_OES_draw_texture, + GL_OES_framebuffer_object, + GL_OES_mapbuffer, + GL_OES_matrix_palette, + GL_OES_query_matrix, + GL_OES_rgb8_rgba8, + GL_OES_stencil8, + GL_OES_texture_npot + Loader: False + Local files: False + Omit khrplatform: False + Reproducible: False + + Commandline: + --profile="core" --api="gles1=1.0" --generator="c" --spec="gl" --no-loader --extensions="GL_EXT_debug_marker,GL_EXT_discard_framebuffer,GL_EXT_texture_format_BGRA8888,GL_OES_EGL_image,GL_OES_EGL_image_external,GL_OES_compressed_ETC1_RGB8_texture,GL_OES_compressed_paletted_texture,GL_OES_depth24,GL_OES_depth32,GL_OES_draw_texture,GL_OES_framebuffer_object,GL_OES_mapbuffer,GL_OES_matrix_palette,GL_OES_query_matrix,GL_OES_rgb8_rgba8,GL_OES_stencil8,GL_OES_texture_npot" + Online: + https://glad.dav1d.de/#profile=core&language=c&specification=gl&api=gles1%3D1.0&extensions=GL_EXT_debug_marker&extensions=GL_EXT_discard_framebuffer&extensions=GL_EXT_texture_format_BGRA8888&extensions=GL_OES_EGL_image&extensions=GL_OES_EGL_image_external&extensions=GL_OES_compressed_ETC1_RGB8_texture&extensions=GL_OES_compressed_paletted_texture&extensions=GL_OES_depth24&extensions=GL_OES_depth32&extensions=GL_OES_draw_texture&extensions=GL_OES_framebuffer_object&extensions=GL_OES_mapbuffer&extensions=GL_OES_matrix_palette&extensions=GL_OES_query_matrix&extensions=GL_OES_rgb8_rgba8&extensions=GL_OES_stencil8&extensions=GL_OES_texture_npot +*/ + +#include +#include +#include +#include + +struct gladGLversionStruct GLVersion = { 0, 0 }; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + unsigned int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i)); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < (unsigned)num_exts_i; index++) { + const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index); + size_t len = strlen(gl_str_tmp); + + char *local_str = (char*)malloc((len+1) * sizeof(char)); + if(local_str != NULL) { + memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char)); + } + exts_i[index] = local_str; + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + int index; + for(index = 0; index < num_exts_i; index++) { + free((char *)exts_i[index]); + } + free((void *)exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + if(exts_i == NULL) return 0; + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(exts_i[index] != NULL && strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_ES_CM_1_0 = 0; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL; +PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL; +PFNGLALPHAFUNCXPROC glad_glAlphaFuncx = NULL; +PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL; +PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL; +PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL; +PFNGLBUFFERDATAPROC glad_glBufferData = NULL; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL; +PFNGLCLEARPROC glad_glClear = NULL; +PFNGLCLEARCOLORPROC glad_glClearColor = NULL; +PFNGLCLEARCOLORXPROC glad_glClearColorx = NULL; +PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL; +PFNGLCLEARDEPTHXPROC glad_glClearDepthx = NULL; +PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL; +PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture = NULL; +PFNGLCLIPPLANEFPROC glad_glClipPlanef = NULL; +PFNGLCLIPPLANEXPROC glad_glClipPlanex = NULL; +PFNGLCOLOR4FPROC glad_glColor4f = NULL; +PFNGLCOLOR4UBPROC glad_glColor4ub = NULL; +PFNGLCOLOR4XPROC glad_glColor4x = NULL; +PFNGLCOLORMASKPROC glad_glColorMask = NULL; +PFNGLCOLORPOINTERPROC glad_glColorPointer = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL; +PFNGLCULLFACEPROC glad_glCullFace = NULL; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL; +PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL; +PFNGLDEPTHMASKPROC glad_glDepthMask = NULL; +PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL; +PFNGLDEPTHRANGEXPROC glad_glDepthRangex = NULL; +PFNGLDISABLEPROC glad_glDisable = NULL; +PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState = NULL; +PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL; +PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL; +PFNGLENABLEPROC glad_glEnable = NULL; +PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState = NULL; +PFNGLFINISHPROC glad_glFinish = NULL; +PFNGLFLUSHPROC glad_glFlush = NULL; +PFNGLFOGFPROC glad_glFogf = NULL; +PFNGLFOGFVPROC glad_glFogfv = NULL; +PFNGLFOGXPROC glad_glFogx = NULL; +PFNGLFOGXVPROC glad_glFogxv = NULL; +PFNGLFRONTFACEPROC glad_glFrontFace = NULL; +PFNGLFRUSTUMFPROC glad_glFrustumf = NULL; +PFNGLFRUSTUMXPROC glad_glFrustumx = NULL; +PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL; +PFNGLGENTEXTURESPROC glad_glGenTextures = NULL; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL; +PFNGLGETCLIPPLANEFPROC glad_glGetClipPlanef = NULL; +PFNGLGETCLIPPLANEXPROC glad_glGetClipPlanex = NULL; +PFNGLGETERRORPROC glad_glGetError = NULL; +PFNGLGETFIXEDVPROC glad_glGetFixedv = NULL; +PFNGLGETFLOATVPROC glad_glGetFloatv = NULL; +PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL; +PFNGLGETLIGHTFVPROC glad_glGetLightfv = NULL; +PFNGLGETLIGHTXVPROC glad_glGetLightxv = NULL; +PFNGLGETMATERIALFVPROC glad_glGetMaterialfv = NULL; +PFNGLGETMATERIALXVPROC glad_glGetMaterialxv = NULL; +PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL; +PFNGLGETSTRINGPROC glad_glGetString = NULL; +PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv = NULL; +PFNGLGETTEXENVIVPROC glad_glGetTexEnviv = NULL; +PFNGLGETTEXENVXVPROC glad_glGetTexEnvxv = NULL; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL; +PFNGLGETTEXPARAMETERXVPROC glad_glGetTexParameterxv = NULL; +PFNGLHINTPROC glad_glHint = NULL; +PFNGLISBUFFERPROC glad_glIsBuffer = NULL; +PFNGLISENABLEDPROC glad_glIsEnabled = NULL; +PFNGLISTEXTUREPROC glad_glIsTexture = NULL; +PFNGLLIGHTMODELFPROC glad_glLightModelf = NULL; +PFNGLLIGHTMODELFVPROC glad_glLightModelfv = NULL; +PFNGLLIGHTMODELXPROC glad_glLightModelx = NULL; +PFNGLLIGHTMODELXVPROC glad_glLightModelxv = NULL; +PFNGLLIGHTFPROC glad_glLightf = NULL; +PFNGLLIGHTFVPROC glad_glLightfv = NULL; +PFNGLLIGHTXPROC glad_glLightx = NULL; +PFNGLLIGHTXVPROC glad_glLightxv = NULL; +PFNGLLINEWIDTHPROC glad_glLineWidth = NULL; +PFNGLLINEWIDTHXPROC glad_glLineWidthx = NULL; +PFNGLLOADIDENTITYPROC glad_glLoadIdentity = NULL; +PFNGLLOADMATRIXFPROC glad_glLoadMatrixf = NULL; +PFNGLLOADMATRIXXPROC glad_glLoadMatrixx = NULL; +PFNGLLOGICOPPROC glad_glLogicOp = NULL; +PFNGLMATERIALFPROC glad_glMaterialf = NULL; +PFNGLMATERIALFVPROC glad_glMaterialfv = NULL; +PFNGLMATERIALXPROC glad_glMaterialx = NULL; +PFNGLMATERIALXVPROC glad_glMaterialxv = NULL; +PFNGLMATRIXMODEPROC glad_glMatrixMode = NULL; +PFNGLMULTMATRIXFPROC glad_glMultMatrixf = NULL; +PFNGLMULTMATRIXXPROC glad_glMultMatrixx = NULL; +PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4XPROC glad_glMultiTexCoord4x = NULL; +PFNGLNORMAL3FPROC glad_glNormal3f = NULL; +PFNGLNORMAL3XPROC glad_glNormal3x = NULL; +PFNGLNORMALPOINTERPROC glad_glNormalPointer = NULL; +PFNGLORTHOFPROC glad_glOrthof = NULL; +PFNGLORTHOXPROC glad_glOrthox = NULL; +PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL; +PFNGLPOINTPARAMETERXPROC glad_glPointParameterx = NULL; +PFNGLPOINTPARAMETERXVPROC glad_glPointParameterxv = NULL; +PFNGLPOINTSIZEPROC glad_glPointSize = NULL; +PFNGLPOINTSIZEXPROC glad_glPointSizex = NULL; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL; +PFNGLPOLYGONOFFSETXPROC glad_glPolygonOffsetx = NULL; +PFNGLPOPMATRIXPROC glad_glPopMatrix = NULL; +PFNGLPUSHMATRIXPROC glad_glPushMatrix = NULL; +PFNGLREADPIXELSPROC glad_glReadPixels = NULL; +PFNGLROTATEFPROC glad_glRotatef = NULL; +PFNGLROTATEXPROC glad_glRotatex = NULL; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL; +PFNGLSAMPLECOVERAGEXPROC glad_glSampleCoveragex = NULL; +PFNGLSCALEFPROC glad_glScalef = NULL; +PFNGLSCALEXPROC glad_glScalex = NULL; +PFNGLSCISSORPROC glad_glScissor = NULL; +PFNGLSHADEMODELPROC glad_glShadeModel = NULL; +PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL; +PFNGLSTENCILMASKPROC glad_glStencilMask = NULL; +PFNGLSTENCILOPPROC glad_glStencilOp = NULL; +PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer = NULL; +PFNGLTEXENVFPROC glad_glTexEnvf = NULL; +PFNGLTEXENVFVPROC glad_glTexEnvfv = NULL; +PFNGLTEXENVIPROC glad_glTexEnvi = NULL; +PFNGLTEXENVIVPROC glad_glTexEnviv = NULL; +PFNGLTEXENVXPROC glad_glTexEnvx = NULL; +PFNGLTEXENVXVPROC glad_glTexEnvxv = NULL; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL; +PFNGLTEXPARAMETERXPROC glad_glTexParameterx = NULL; +PFNGLTEXPARAMETERXVPROC glad_glTexParameterxv = NULL; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL; +PFNGLTRANSLATEFPROC glad_glTranslatef = NULL; +PFNGLTRANSLATEXPROC glad_glTranslatex = NULL; +PFNGLVERTEXPOINTERPROC glad_glVertexPointer = NULL; +PFNGLVIEWPORTPROC glad_glViewport = NULL; +int GLAD_GL_EXT_debug_marker = 0; +int GLAD_GL_EXT_discard_framebuffer = 0; +int GLAD_GL_EXT_texture_format_BGRA8888 = 0; +int GLAD_GL_OES_EGL_image = 0; +int GLAD_GL_OES_EGL_image_external = 0; +int GLAD_GL_OES_compressed_ETC1_RGB8_texture = 0; +int GLAD_GL_OES_compressed_paletted_texture = 0; +int GLAD_GL_OES_depth24 = 0; +int GLAD_GL_OES_depth32 = 0; +int GLAD_GL_OES_draw_texture = 0; +int GLAD_GL_OES_framebuffer_object = 0; +int GLAD_GL_OES_mapbuffer = 0; +int GLAD_GL_OES_matrix_palette = 0; +int GLAD_GL_OES_query_matrix = 0; +int GLAD_GL_OES_rgb8_rgba8 = 0; +int GLAD_GL_OES_stencil8 = 0; +int GLAD_GL_OES_texture_npot = 0; +PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT = NULL; +PFNGLDISCARDFRAMEBUFFEREXTPROC glad_glDiscardFramebufferEXT = NULL; +PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glad_glEGLImageTargetTexture2DOES = NULL; +PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glad_glEGLImageTargetRenderbufferStorageOES = NULL; +PFNGLDRAWTEXSOESPROC glad_glDrawTexsOES = NULL; +PFNGLDRAWTEXIOESPROC glad_glDrawTexiOES = NULL; +PFNGLDRAWTEXXOESPROC glad_glDrawTexxOES = NULL; +PFNGLDRAWTEXSVOESPROC glad_glDrawTexsvOES = NULL; +PFNGLDRAWTEXIVOESPROC glad_glDrawTexivOES = NULL; +PFNGLDRAWTEXXVOESPROC glad_glDrawTexxvOES = NULL; +PFNGLDRAWTEXFOESPROC glad_glDrawTexfOES = NULL; +PFNGLDRAWTEXFVOESPROC glad_glDrawTexfvOES = NULL; +PFNGLISRENDERBUFFEROESPROC glad_glIsRenderbufferOES = NULL; +PFNGLBINDRENDERBUFFEROESPROC glad_glBindRenderbufferOES = NULL; +PFNGLDELETERENDERBUFFERSOESPROC glad_glDeleteRenderbuffersOES = NULL; +PFNGLGENRENDERBUFFERSOESPROC glad_glGenRenderbuffersOES = NULL; +PFNGLRENDERBUFFERSTORAGEOESPROC glad_glRenderbufferStorageOES = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVOESPROC glad_glGetRenderbufferParameterivOES = NULL; +PFNGLISFRAMEBUFFEROESPROC glad_glIsFramebufferOES = NULL; +PFNGLBINDFRAMEBUFFEROESPROC glad_glBindFramebufferOES = NULL; +PFNGLDELETEFRAMEBUFFERSOESPROC glad_glDeleteFramebuffersOES = NULL; +PFNGLGENFRAMEBUFFERSOESPROC glad_glGenFramebuffersOES = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSOESPROC glad_glCheckFramebufferStatusOES = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEROESPROC glad_glFramebufferRenderbufferOES = NULL; +PFNGLFRAMEBUFFERTEXTURE2DOESPROC glad_glFramebufferTexture2DOES = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC glad_glGetFramebufferAttachmentParameterivOES = NULL; +PFNGLGENERATEMIPMAPOESPROC glad_glGenerateMipmapOES = NULL; +PFNGLMAPBUFFEROESPROC glad_glMapBufferOES = NULL; +PFNGLUNMAPBUFFEROESPROC glad_glUnmapBufferOES = NULL; +PFNGLGETBUFFERPOINTERVOESPROC glad_glGetBufferPointervOES = NULL; +PFNGLCURRENTPALETTEMATRIXOESPROC glad_glCurrentPaletteMatrixOES = NULL; +PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC glad_glLoadPaletteFromModelViewMatrixOES = NULL; +PFNGLMATRIXINDEXPOINTEROESPROC glad_glMatrixIndexPointerOES = NULL; +PFNGLWEIGHTPOINTEROESPROC glad_glWeightPointerOES = NULL; +PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES = NULL; +static void load_GL_VERSION_ES_CM_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_ES_CM_1_0) return; + glad_glAlphaFunc = (PFNGLALPHAFUNCPROC)load("glAlphaFunc"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); + glad_glClipPlanef = (PFNGLCLIPPLANEFPROC)load("glClipPlanef"); + glad_glColor4f = (PFNGLCOLOR4FPROC)load("glColor4f"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glFogf = (PFNGLFOGFPROC)load("glFogf"); + glad_glFogfv = (PFNGLFOGFVPROC)load("glFogfv"); + glad_glFrustumf = (PFNGLFRUSTUMFPROC)load("glFrustumf"); + glad_glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)load("glGetClipPlanef"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetLightfv = (PFNGLGETLIGHTFVPROC)load("glGetLightfv"); + glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC)load("glGetMaterialfv"); + glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)load("glGetTexEnvfv"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glLightModelf = (PFNGLLIGHTMODELFPROC)load("glLightModelf"); + glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC)load("glLightModelfv"); + glad_glLightf = (PFNGLLIGHTFPROC)load("glLightf"); + glad_glLightfv = (PFNGLLIGHTFVPROC)load("glLightfv"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC)load("glLoadMatrixf"); + glad_glMaterialf = (PFNGLMATERIALFPROC)load("glMaterialf"); + glad_glMaterialfv = (PFNGLMATERIALFVPROC)load("glMaterialfv"); + glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC)load("glMultMatrixf"); + glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)load("glMultiTexCoord4f"); + glad_glNormal3f = (PFNGLNORMAL3FPROC)load("glNormal3f"); + glad_glOrthof = (PFNGLORTHOFPROC)load("glOrthof"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glRotatef = (PFNGLROTATEFPROC)load("glRotatef"); + glad_glScalef = (PFNGLSCALEFPROC)load("glScalef"); + glad_glTexEnvf = (PFNGLTEXENVFPROC)load("glTexEnvf"); + glad_glTexEnvfv = (PFNGLTEXENVFVPROC)load("glTexEnvfv"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTranslatef = (PFNGLTRANSLATEFPROC)load("glTranslatef"); + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glAlphaFuncx = (PFNGLALPHAFUNCXPROC)load("glAlphaFuncx"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColorx = (PFNGLCLEARCOLORXPROC)load("glClearColorx"); + glad_glClearDepthx = (PFNGLCLEARDEPTHXPROC)load("glClearDepthx"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)load("glClientActiveTexture"); + glad_glClipPlanex = (PFNGLCLIPPLANEXPROC)load("glClipPlanex"); + glad_glColor4ub = (PFNGLCOLOR4UBPROC)load("glColor4ub"); + glad_glColor4x = (PFNGLCOLOR4XPROC)load("glColor4x"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glColorPointer = (PFNGLCOLORPOINTERPROC)load("glColorPointer"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDepthRangex = (PFNGLDEPTHRANGEXPROC)load("glDepthRangex"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)load("glDisableClientState"); + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)load("glEnableClientState"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glFogx = (PFNGLFOGXPROC)load("glFogx"); + glad_glFogxv = (PFNGLFOGXVPROC)load("glFogxv"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glFrustumx = (PFNGLFRUSTUMXPROC)load("glFrustumx"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)load("glGetClipPlanex"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFixedv = (PFNGLGETFIXEDVPROC)load("glGetFixedv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetLightxv = (PFNGLGETLIGHTXVPROC)load("glGetLightxv"); + glad_glGetMaterialxv = (PFNGLGETMATERIALXVPROC)load("glGetMaterialxv"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC)load("glGetTexEnviv"); + glad_glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)load("glGetTexEnvxv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)load("glGetTexParameterxv"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glLightModelx = (PFNGLLIGHTMODELXPROC)load("glLightModelx"); + glad_glLightModelxv = (PFNGLLIGHTMODELXVPROC)load("glLightModelxv"); + glad_glLightx = (PFNGLLIGHTXPROC)load("glLightx"); + glad_glLightxv = (PFNGLLIGHTXVPROC)load("glLightxv"); + glad_glLineWidthx = (PFNGLLINEWIDTHXPROC)load("glLineWidthx"); + glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC)load("glLoadIdentity"); + glad_glLoadMatrixx = (PFNGLLOADMATRIXXPROC)load("glLoadMatrixx"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glMaterialx = (PFNGLMATERIALXPROC)load("glMaterialx"); + glad_glMaterialxv = (PFNGLMATERIALXVPROC)load("glMaterialxv"); + glad_glMatrixMode = (PFNGLMATRIXMODEPROC)load("glMatrixMode"); + glad_glMultMatrixx = (PFNGLMULTMATRIXXPROC)load("glMultMatrixx"); + glad_glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)load("glMultiTexCoord4x"); + glad_glNormal3x = (PFNGLNORMAL3XPROC)load("glNormal3x"); + glad_glNormalPointer = (PFNGLNORMALPOINTERPROC)load("glNormalPointer"); + glad_glOrthox = (PFNGLORTHOXPROC)load("glOrthox"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glPointParameterx = (PFNGLPOINTPARAMETERXPROC)load("glPointParameterx"); + glad_glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)load("glPointParameterxv"); + glad_glPointSizex = (PFNGLPOINTSIZEXPROC)load("glPointSizex"); + glad_glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)load("glPolygonOffsetx"); + glad_glPopMatrix = (PFNGLPOPMATRIXPROC)load("glPopMatrix"); + glad_glPushMatrix = (PFNGLPUSHMATRIXPROC)load("glPushMatrix"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glRotatex = (PFNGLROTATEXPROC)load("glRotatex"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)load("glSampleCoveragex"); + glad_glScalex = (PFNGLSCALEXPROC)load("glScalex"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glShadeModel = (PFNGLSHADEMODELPROC)load("glShadeModel"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)load("glTexCoordPointer"); + glad_glTexEnvi = (PFNGLTEXENVIPROC)load("glTexEnvi"); + glad_glTexEnvx = (PFNGLTEXENVXPROC)load("glTexEnvx"); + glad_glTexEnviv = (PFNGLTEXENVIVPROC)load("glTexEnviv"); + glad_glTexEnvxv = (PFNGLTEXENVXVPROC)load("glTexEnvxv"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameterx = (PFNGLTEXPARAMETERXPROC)load("glTexParameterx"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)load("glTexParameterxv"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glTranslatex = (PFNGLTRANSLATEXPROC)load("glTranslatex"); + glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC)load("glVertexPointer"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); +} +static void load_GL_EXT_debug_marker(GLADloadproc load) { + if(!GLAD_GL_EXT_debug_marker) return; + glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); + glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); + glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); +} +static void load_GL_EXT_discard_framebuffer(GLADloadproc load) { + if(!GLAD_GL_EXT_discard_framebuffer) return; + glad_glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)load("glDiscardFramebufferEXT"); +} +static void load_GL_OES_EGL_image(GLADloadproc load) { + if(!GLAD_GL_OES_EGL_image) return; + glad_glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)load("glEGLImageTargetTexture2DOES"); + glad_glEGLImageTargetRenderbufferStorageOES = (PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC)load("glEGLImageTargetRenderbufferStorageOES"); +} +static void load_GL_OES_draw_texture(GLADloadproc load) { + if(!GLAD_GL_OES_draw_texture) return; + glad_glDrawTexsOES = (PFNGLDRAWTEXSOESPROC)load("glDrawTexsOES"); + glad_glDrawTexiOES = (PFNGLDRAWTEXIOESPROC)load("glDrawTexiOES"); + glad_glDrawTexxOES = (PFNGLDRAWTEXXOESPROC)load("glDrawTexxOES"); + glad_glDrawTexsvOES = (PFNGLDRAWTEXSVOESPROC)load("glDrawTexsvOES"); + glad_glDrawTexivOES = (PFNGLDRAWTEXIVOESPROC)load("glDrawTexivOES"); + glad_glDrawTexxvOES = (PFNGLDRAWTEXXVOESPROC)load("glDrawTexxvOES"); + glad_glDrawTexfOES = (PFNGLDRAWTEXFOESPROC)load("glDrawTexfOES"); + glad_glDrawTexfvOES = (PFNGLDRAWTEXFVOESPROC)load("glDrawTexfvOES"); +} +static void load_GL_OES_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_OES_framebuffer_object) return; + glad_glIsRenderbufferOES = (PFNGLISRENDERBUFFEROESPROC)load("glIsRenderbufferOES"); + glad_glBindRenderbufferOES = (PFNGLBINDRENDERBUFFEROESPROC)load("glBindRenderbufferOES"); + glad_glDeleteRenderbuffersOES = (PFNGLDELETERENDERBUFFERSOESPROC)load("glDeleteRenderbuffersOES"); + glad_glGenRenderbuffersOES = (PFNGLGENRENDERBUFFERSOESPROC)load("glGenRenderbuffersOES"); + glad_glRenderbufferStorageOES = (PFNGLRENDERBUFFERSTORAGEOESPROC)load("glRenderbufferStorageOES"); + glad_glGetRenderbufferParameterivOES = (PFNGLGETRENDERBUFFERPARAMETERIVOESPROC)load("glGetRenderbufferParameterivOES"); + glad_glIsFramebufferOES = (PFNGLISFRAMEBUFFEROESPROC)load("glIsFramebufferOES"); + glad_glBindFramebufferOES = (PFNGLBINDFRAMEBUFFEROESPROC)load("glBindFramebufferOES"); + glad_glDeleteFramebuffersOES = (PFNGLDELETEFRAMEBUFFERSOESPROC)load("glDeleteFramebuffersOES"); + glad_glGenFramebuffersOES = (PFNGLGENFRAMEBUFFERSOESPROC)load("glGenFramebuffersOES"); + glad_glCheckFramebufferStatusOES = (PFNGLCHECKFRAMEBUFFERSTATUSOESPROC)load("glCheckFramebufferStatusOES"); + glad_glFramebufferRenderbufferOES = (PFNGLFRAMEBUFFERRENDERBUFFEROESPROC)load("glFramebufferRenderbufferOES"); + glad_glFramebufferTexture2DOES = (PFNGLFRAMEBUFFERTEXTURE2DOESPROC)load("glFramebufferTexture2DOES"); + glad_glGetFramebufferAttachmentParameterivOES = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC)load("glGetFramebufferAttachmentParameterivOES"); + glad_glGenerateMipmapOES = (PFNGLGENERATEMIPMAPOESPROC)load("glGenerateMipmapOES"); +} +static void load_GL_OES_mapbuffer(GLADloadproc load) { + if(!GLAD_GL_OES_mapbuffer) return; + glad_glMapBufferOES = (PFNGLMAPBUFFEROESPROC)load("glMapBufferOES"); + glad_glUnmapBufferOES = (PFNGLUNMAPBUFFEROESPROC)load("glUnmapBufferOES"); + glad_glGetBufferPointervOES = (PFNGLGETBUFFERPOINTERVOESPROC)load("glGetBufferPointervOES"); +} +static void load_GL_OES_matrix_palette(GLADloadproc load) { + if(!GLAD_GL_OES_matrix_palette) return; + glad_glCurrentPaletteMatrixOES = (PFNGLCURRENTPALETTEMATRIXOESPROC)load("glCurrentPaletteMatrixOES"); + glad_glLoadPaletteFromModelViewMatrixOES = (PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC)load("glLoadPaletteFromModelViewMatrixOES"); + glad_glMatrixIndexPointerOES = (PFNGLMATRIXINDEXPOINTEROESPROC)load("glMatrixIndexPointerOES"); + glad_glWeightPointerOES = (PFNGLWEIGHTPOINTEROESPROC)load("glWeightPointerOES"); +} +static void load_GL_OES_query_matrix(GLADloadproc load) { + if(!GLAD_GL_OES_query_matrix) return; + glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); +} +static int find_extensionsGLES1(void) { + if (!get_exts()) return 0; + GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); + GLAD_GL_EXT_discard_framebuffer = has_ext("GL_EXT_discard_framebuffer"); + GLAD_GL_EXT_texture_format_BGRA8888 = has_ext("GL_EXT_texture_format_BGRA8888"); + GLAD_GL_OES_EGL_image = has_ext("GL_OES_EGL_image"); + GLAD_GL_OES_EGL_image_external = has_ext("GL_OES_EGL_image_external"); + GLAD_GL_OES_compressed_ETC1_RGB8_texture = has_ext("GL_OES_compressed_ETC1_RGB8_texture"); + GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); + GLAD_GL_OES_depth24 = has_ext("GL_OES_depth24"); + GLAD_GL_OES_depth32 = has_ext("GL_OES_depth32"); + GLAD_GL_OES_draw_texture = has_ext("GL_OES_draw_texture"); + GLAD_GL_OES_framebuffer_object = has_ext("GL_OES_framebuffer_object"); + GLAD_GL_OES_mapbuffer = has_ext("GL_OES_mapbuffer"); + GLAD_GL_OES_matrix_palette = has_ext("GL_OES_matrix_palette"); + GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); + GLAD_GL_OES_rgb8_rgba8 = has_ext("GL_OES_rgb8_rgba8"); + GLAD_GL_OES_stencil8 = has_ext("GL_OES_stencil8"); + GLAD_GL_OES_texture_npot = has_ext("GL_OES_texture_npot"); + free_exts(); + return 1; +} + +static void find_coreGLES1(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_ES_CM_1_0 = (major == 1 && minor >= 0) || major > 1; + if (GLVersion.major > 1 || (GLVersion.major >= 1 && GLVersion.minor >= 0)) { + max_loaded_major = 1; + max_loaded_minor = 0; + } +} + +int gladLoadGLES1Loader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGLES1(); + load_GL_VERSION_ES_CM_1_0(load); + + if (!find_extensionsGLES1()) return 0; + load_GL_EXT_debug_marker(load); + load_GL_EXT_discard_framebuffer(load); + load_GL_OES_EGL_image(load); + load_GL_OES_draw_texture(load); + load_GL_OES_framebuffer_object(load); + load_GL_OES_mapbuffer(load); + load_GL_OES_matrix_palette(load); + load_GL_OES_query_matrix(load); + return GLVersion.major != 0 || GLVersion.minor != 0; +} + diff --git a/src/client/refresh/gl1/header/local.h b/src/client/refresh/gl1/header/local.h index 68ca54ae..3f07e045 100644 --- a/src/client/refresh/gl1/header/local.h +++ b/src/client/refresh/gl1/header/local.h @@ -31,12 +31,22 @@ #include #include +#ifdef YQ2_GL1_GLES +#include "../glad-gles1/include/glad/glad.h" +#endif + #include "../../ref_shared.h" #include "qgl.h" - +#ifdef YQ2_GL1_GLES +#define REF_VERSION "Yamagi Quake II OpenGL ES1 Refresher" +#define GL_COLOR_INDEX GL_RGBA +#define GL_COLOR_INDEX8_EXT GL_RGBA +#else +#define REF_VERSION "Yamagi Quake II OpenGL Refresher" #ifndef GL_COLOR_INDEX8_EXT - #define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX +#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX +#endif #endif #define MAX_LIGHTMAPS 128 @@ -47,7 +57,6 @@ #define MAX_GLTEXTURES 1024 #define BLOCK_WIDTH 128 // default values; now defined in glstate_t #define BLOCK_HEIGHT 128 -#define REF_VERSION "Yamagi Quake II OpenGL Refresher" #define BACKFACE_EPSILON 0.01 #define LIGHTMAP_BYTES 4 #define MAX_TEXTURE_UNITS 2 @@ -337,6 +346,12 @@ void R_Buffer2DQuad(GLfloat ul_vx, GLfloat ul_vy, GLfloat dr_vx, GLfloat dr_vy, GLfloat ul_tx, GLfloat ul_ty, GLfloat dr_tx, GLfloat dr_ty); void R_SetBufferIndices(GLenum type, GLuint vertices_num); +#ifdef YQ2_GL1_GLES +#define glPolygonMode(...) +#define glFrustum(...) glFrustumf(__VA_ARGS__) +#define glDepthRange(...) glDepthRangef(__VA_ARGS__) +#define glOrtho(...) glOrthof(__VA_ARGS__) +#else #ifdef DEBUG void glCheckError_(const char *file, const char *function, int line); // Ideally, the following list should contain all OpenGL calls. @@ -386,6 +401,7 @@ void glCheckError_(const char *file, const char *function, int line); #define glBegin(...) glBegin(__VA_ARGS__); glCheckError_(__FILE__, __func__, __LINE__) #define glEnd() glEnd(); glCheckError_(__FILE__, __func__, __LINE__) #endif +#endif /* GL extension emulation functions */ void R_DrawParticles2(int n, diff --git a/src/client/refresh/gl1/header/qgl.h b/src/client/refresh/gl1/header/qgl.h index 7e30662d..ef7e2472 100644 --- a/src/client/refresh/gl1/header/qgl.h +++ b/src/client/refresh/gl1/header/qgl.h @@ -35,10 +35,17 @@ #if defined(__APPLE__) #define GL_SILENCE_DEPRECATION +#endif + +#ifdef YQ2_GL1_GLES +#include +#else +#if defined(__APPLE__) #include #else #include #endif +#endif #ifndef APIENTRY #define APIENTRY