Load OpenGL through SDL instead of glad

gl.h lists the 62 functions the editor calls, loaded with SDL_GL_GetProcAddress into gl, as in smack-a-brother.
The 25k lines of glad and KHR headers are gone.
This commit is contained in:
shweet committed 2026-11-22 17:36:29 -05:00
1 parent 7e81ea4259
commit 6f2fc8c196
18 files changed
+254 -25290

No files matched your search

+4 -4
View File
@@ -16,7 +16,7 @@
#include <SDL3/SDL_timer.h>
#include <SDL3/SDL_video.h>
#include <glad/glad.h>
#include "gl.h"
#include "audio.h"
#include "canvas.h"
@@ -258,15 +258,15 @@ HeadlessGL::HeadlessGL()
window = SDL_CreateWindow("anm2ed", 1, 1, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN);
if (window)
context = SDL_GL_CreateContext(window);
if (!context || !gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress))
if (!context || !gl_load())
{
if (context)
SDL_GL_DestroyContext(context);
context = nullptr;
return;
}
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
gl.Enable(GL_BLEND);
gl.Disable(GL_DEPTH_TEST);
}
HeadlessGL::~HeadlessGL()