Set the currently-active OpenGL context.
Defined in <SDL3/SDL_video.h>
bool SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context);| SDL_Window * | window | the window to associate with the context. |
| SDL_GLContext | context | the OpenGL context to associate with the window. |
(bool) Returns true on success or false on failure; call SDL_GetError() for more information.
This function makes a GL context "current," in all the ways that term implies in OpenGL.
This is a per-thread state that specifies what context future calls into OpenGL will operate on. Beyond context creation work, you must have a current context for the thread before attempting to use OpenGL in any way.
The context must have been created with a compatible window.
It is safe to call this function from any thread (as long as a unique GL context was created for that thread).
This function is available since SDL 3.2.0.