Skip to content

Commit

Permalink
WARNING: REDESIGNED: rlLoadExtensions() #1295
Browse files Browse the repository at this point in the history
Added config flag: SUPPORT_GL_DETAILS_INFO
  • Loading branch information
raysan5 committed Apr 18, 2021
1 parent 2ad3eb1 commit d4ccca8
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 195 deletions.
3 changes: 3 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
//------------------------------------------------------------------------------------
// Module: rlgl - Configuration values
//------------------------------------------------------------------------------------
// Show OpenGL extensions and capabilities detailed logs on init
//#define SUPPORT_GL_DETAILS_INFO 1

#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33)
#define DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch limits
#elif defined(GRAPHICS_API_OPENGL_ES2)
Expand Down
11 changes: 5 additions & 6 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3770,12 +3770,6 @@ static bool InitGraphicsDevice(int width, int height)
glfwSwapInterval(0); // No V-Sync by default
#endif

#if defined(PLATFORM_DESKTOP)
// Load OpenGL 3.3 extensions
// NOTE: GLFW loader function is passed as parameter
rlLoadExtensions(glfwGetProcAddress);
#endif

// Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS)
// NOTE: V-Sync can be enabled by graphic driver configuration
if (CORE.Window.flags & FLAG_VSYNC_HINT)
Expand Down Expand Up @@ -4357,6 +4351,11 @@ static bool InitGraphicsDevice(int width, int height)
}
#endif // PLATFORM_ANDROID || PLATFORM_RPI || PLATFORM_DRM || PLATFORM_UWP

// Load OpenGL extensions
// NOTE: GLFW loader function is required by GLAD but only used for OpenGL 2.1 and 3.3,
// OpenGL ES 2.0 extensions (and entry points) are loaded manually using eglGetProcAddress()
rlLoadExtensions(glfwGetProcAddress);

// Initialize OpenGL context (states and resources)
// NOTE: CORE.Window.screen.width and CORE.Window.screen.height not used, just stored as globals in rlgl
rlglInit(CORE.Window.screen.width, CORE.Window.screen.height);
Expand Down
Loading

0 comments on commit d4ccca8

Please sign in to comment.