Corrected bugs on OpenGL 2.1

This commit is contained in:
Ray
2016-06-17 00:29:46 +02:00
parent 4df7a0f2f8
commit 9fdf4420d5
3 changed files with 15 additions and 10 deletions

View File

@@ -1214,14 +1214,17 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height)
// NOTE: External loader function could be passed as a pointer
void rlglLoadExtensions(void *loader)
{
#if defined(GRAPHICS_API_OPENGL_33)
// NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions
#if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33)
// NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions)
if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions");
else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully");
#if defined(GRAPHICS_API_OPENGL_21)
if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported");
else if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported");
#elif defined(GRAPHICS_API_OPENGL_33)
if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported");
else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported");
#endif
// With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans
//if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object
@@ -2597,6 +2600,8 @@ void EndOculusDrawing(void)
// Blit mirror texture to back buffer
BlitOculusMirror(session, mirror);
rlDisableDepthTest();
}
#endif