GLES2: Log BGRA support

This commit is contained in:
UnknownShadow200 2025-02-24 06:16:26 +11:00
parent 398eceafca
commit 9dff9a2b14
2 changed files with 9 additions and 1 deletions

View File

@ -546,6 +546,14 @@ static void GLBackend_Init(void) {
glGetIntegerv(_GL_MAJOR_VERSION, &major);
glGetIntegerv(_GL_MINOR_VERSION, &minor);
customMipmapsLevels = major >= 3 && minor >= 2;
static const cc_string bgra_ext = String_FromConst("EXT_texture_format_BGRA8888");
static const cc_string bgra_apl = String_FromConst("APPLE_texture_format_BGRA8888");
cc_string extensions = String_FromReadonly((const char*)_glGetString(GL_EXTENSIONS));
cc_bool has_ext_bgra = String_CaselessContains(&extensions, &bgra_ext);
cc_bool has_apl_bgra = String_CaselessContains(&extensions, &bgra_apl);
Platform_Log2("BGRA support - Ext: %t, Apple: %t", &has_ext_bgra, &has_apl_bgra);
#else
customMipmapsLevels = true;
const GLubyte* ver = glGetString(GL_VERSION);

View File

@ -114,7 +114,7 @@ static cc_uintptr ctx_visualID;
static void GLContext_InitSurface(void); // replacement in Window_Switch.c for handheld/docked resolution fix
#else
static void GLContext_InitSurface(void) {
void* window = Window_Main.Handle.ptr;
EGLNativeWindowType window = (EGLNativeWindowType)Window_Main.Handle.ptr;
if (!window) return; /* window not created or lost */
ctx_surface = eglCreateWindowSurface(ctx_display, ctx_config, window, NULL);