More explicit extension checking

This commit is contained in:
Not-Nik 2022-09-18 20:59:41 +02:00
parent 7335ef7786
commit 17878b802b
No known key found for this signature in database
GPG Key ID: 08BB71E672DB3BFD

View File

@ -2012,21 +2012,29 @@ void rlLoadExtensions(void *loader)
#endif #endif
#if defined(GRAPHICS_API_OPENGL_21) #if defined(GRAPHICS_API_OPENGL_21)
#define CORE_OPENGL_33 false // Register supported extensions flags
// Optional OpenGL 2.1 extensions
RLGL.ExtSupported.vao = GLAD_GL_ARB_vertex_array_object;
RLGL.ExtSupported.instancing = (GLAD_GL_EXT_draw_instanced && GLAD_GL_ARB_instanced_arrays);
RLGL.ExtSupported.texNPOT = GLAD_GL_ARB_texture_non_power_of_two;
RLGL.ExtSupported.texFloat32 = GLAD_GL_ARB_texture_float;
RLGL.ExtSupported.texDepth = GLAD_GL_ARB_depth_texture;
RLGL.ExtSupported.maxDepthBits = 32;
RLGL.ExtSupported.texAnisoFilter = GLAD_GL_EXT_texture_filter_anisotropic;
RLGL.ExtSupported.texMirrorClamp = GLAD_GL_EXT_texture_mirror_clamp;
#else #else
#define CORE_OPENGL_33 true // Register supported extensions flags
// OpenGL 3.3 extensions supported by default (core)
RLGL.ExtSupported.vao = true;
RLGL.ExtSupported.instancing = true;
RLGL.ExtSupported.texNPOT = true;
RLGL.ExtSupported.texFloat32 = true;
RLGL.ExtSupported.texDepth = true;
RLGL.ExtSupported.maxDepthBits = 32;
RLGL.ExtSupported.texAnisoFilter = true;
RLGL.ExtSupported.texMirrorClamp = true;
#endif #endif
// Register supported extensions flags
// OpenGL 3.3 extensions supported by default (core) or optional in OpenGL 2.1
RLGL.ExtSupported.vao = CORE_OPENGL_33 || GLAD_GL_ARB_vertex_array_object;
RLGL.ExtSupported.instancing = CORE_OPENGL_33 || (GLAD_GL_EXT_draw_instanced && GLAD_GL_ARB_instanced_arrays);
RLGL.ExtSupported.texNPOT = CORE_OPENGL_33 || GLAD_GL_ARB_texture_non_power_of_two;
RLGL.ExtSupported.texFloat32 = CORE_OPENGL_33 || GLAD_GL_ARB_texture_float;
RLGL.ExtSupported.texDepth = CORE_OPENGL_33 || GLAD_GL_ARB_depth_texture;
RLGL.ExtSupported.maxDepthBits = 32;
RLGL.ExtSupported.texAnisoFilter = CORE_OPENGL_33 || GLAD_GL_EXT_texture_filter_anisotropic;
RLGL.ExtSupported.texMirrorClamp = CORE_OPENGL_33 || GLAD_GL_EXT_texture_mirror_clamp;
// Optional OpenGL 3.3 extensions // Optional OpenGL 3.3 extensions
RLGL.ExtSupported.texCompASTC = GLAD_GL_KHR_texture_compression_astc_hdr && GLAD_GL_KHR_texture_compression_astc_ldr; RLGL.ExtSupported.texCompASTC = GLAD_GL_KHR_texture_compression_astc_hdr && GLAD_GL_KHR_texture_compression_astc_ldr;
RLGL.ExtSupported.texCompDXT = GLAD_GL_EXT_texture_compression_s3tc; // Texture compression: DXT RLGL.ExtSupported.texCompDXT = GLAD_GL_EXT_texture_compression_s3tc; // Texture compression: DXT
@ -2036,7 +2044,6 @@ void rlLoadExtensions(void *loader)
RLGL.ExtSupported.ssbo = GLAD_GL_ARB_shader_storage_buffer_object; RLGL.ExtSupported.ssbo = GLAD_GL_ARB_shader_storage_buffer_object;
#endif #endif
#undef CORE_OPENGL_33
#endif // GRAPHICS_API_OPENGL_33 #endif // GRAPHICS_API_OPENGL_33
#if defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_ES2)