OpenGL & Vulkan windowsSDL 3.2

SDL_GL_DestroyContext

Destroys an OpenGL context (SDL_GL_DeleteContext in SDL2).

Signature

bool SDL_GL_DestroyContext(SDL_GLContext context);

How it works

Delete your GL objects first, while the context still exists; then destroy the context, then the window.

Parameters

contextSDL_GLContext

The context to destroy.

Return value

true on success, false on failure.

Example

example.cpp
1glDeleteProgram(program);
2SDL_GL_DestroyContext(gl);
3SDL_DestroyWindow(window);
Official SDL wiki