sdl3_opengl files
SDL3 + OpenGL function loading
C 98.9% Makefile 1.1%wget https://git.christianimmanuel.de/sdl-graphics/sdl3_opengl/archive/sdl3_opengl.tar.gzmain.cpp raw
#include <SDL3/SDL.h>
#include <GLES2/gl2.h>
#include <iostream>
#include <memory>
#include <string_view>
int main(int argc, char* argv[]) {
SDL_Init(SDL_INIT_VIDEO);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_Window* win = SDL_CreateWindow(
"GLES2 test",
640, 480,
SDL_WINDOW_OPENGL
);
SDL_GLContext ctx = SDL_GL_CreateContext(win);
SDL_GL_MakeCurrent(win, ctx);
SDL_Log("GL_VERSION: %s", glGetString(GL_VERSION));
return 0;
}