From 753dff9ffcd617fdd0af985246a075e050ff202b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 26 Jan 2025 12:32:35 +1100 Subject: [PATCH] Fix mipmaps level not being properly calculated for modern opengl build --- src/Graphics_GL1.c | 2 ++ src/Graphics_GL2.c | 3 +++ src/_GLShared.h | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Graphics_GL1.c b/src/Graphics_GL1.c index e8af44134..95202da52 100644 --- a/src/Graphics_GL1.c +++ b/src/Graphics_GL1.c @@ -72,7 +72,9 @@ typedef void (*GL_SetupVBFunc)(void); typedef void (*GL_SetupVBRangeFunc)(int startVertex); static GL_SetupVBFunc gfx_setupVBFunc; static GL_SetupVBRangeFunc gfx_setupVBRangeFunc; + #include "_GLShared.h" +static void GLBackend_Init(void); void Gfx_Create(void) { GLContext_Create(); diff --git a/src/Graphics_GL2.c b/src/Graphics_GL2.c index 579900b4e..c030a26f8 100644 --- a/src/Graphics_GL2.c +++ b/src/Graphics_GL2.c @@ -36,6 +36,8 @@ static const struct DynamicLibSym core_funcs[] = { #include "../misc/opengl/GL1Macros.h" #include "_GLShared.h" +static void GLBackend_Init(void); + static GfxResourceID white_square; static int postProcess; enum PostProcess { POSTPROCESS_NONE, POSTPROCESS_GRAYSCALE }; @@ -49,6 +51,7 @@ void Gfx_Create(void) { Gfx.BackendType = CC_GFX_BACKEND_GL2; GL_InitCommon(); + GLBackend_Init(); Gfx_RestoreState(); GLContext_SetVSync(gfx_vsync); } diff --git a/src/_GLShared.h b/src/_GLShared.h index a7d28e0d4..ced222efb 100644 --- a/src/_GLShared.h +++ b/src/_GLShared.h @@ -25,8 +25,6 @@ /*########################################################################################################################* *---------------------------------------------------------General---------------------------------------------------------* *#########################################################################################################################*/ -static void GLBackend_Init(void); - static void GLContext_GetAll(const struct DynamicLibSym* syms, int count) { int i; for (i = 0; i < count; i++)