From dd9d3dc6f1a466feb13e19f4c98cd911508f53d4 Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 11 Nov 2022 12:15:24 -0500 Subject: readme --- tests/sdl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/sdl.c') diff --git a/tests/sdl.c b/tests/sdl.c index a3c3d8f..31331c0 100644 --- a/tests/sdl.c +++ b/tests/sdl.c @@ -8,8 +8,10 @@ int main(void) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Window *window = SDL_CreateWindow("hi", 0, 0, 1280, 720, SDL_WINDOW_SHOWN|SDL_WINDOW_OPENGL); SDL_GLContext ctx = SDL_GL_CreateContext(window); - PFNGLCLEARPROC glClear = SDL_GL_GetProcAddress("glClear"); - PFNGLCLEARCOLORPROC glClearColor = SDL_GL_GetProcAddress("glClearColor"); + // we save a byte this way since we don't need an extra relocation. + void *(*volatile get_proc_address)() = SDL_GL_GetProcAddress; + PFNGLCLEARPROC glClear = get_proc_address("glClear"); + PFNGLCLEARCOLORPROC glClearColor = get_proc_address("glClearColor"); SDL_GL_SetSwapInterval(1); while (true) { SDL_Event event; -- cgit v1.2.3