diff options
author | pommicket <pommicket@gmail.com> | 2022-11-11 12:15:24 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-11-11 12:15:24 -0500 |
commit | dd9d3dc6f1a466feb13e19f4c98cd911508f53d4 (patch) | |
tree | d7e28780d5d93b72b57682c5780d0f3207345ba3 /tests/sdl.c | |
parent | 7b14e052884a1cebf77045d66a686cadfe4d38f6 (diff) |
Diffstat (limited to 'tests/sdl.c')
-rw-r--r-- | tests/sdl.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |