From 721d73f451b1b65201f8350c2aa70df5a4249915 Mon Sep 17 00:00:00 2001 From: Themaister Date: Tue, 13 Sep 2011 22:16:34 +0200 Subject: [PATCH] Fix stupid crash. --- gfx/sdlwrap.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gfx/sdlwrap.c b/gfx/sdlwrap.c index ec17ed6189..fcd27168a8 100644 --- a/gfx/sdlwrap.c +++ b/gfx/sdlwrap.c @@ -27,16 +27,23 @@ // SDL 1.2 is portable, sure, but you still need some platform specific workarounds ;) // Hopefully SDL 1.3 will solve this more cleanly :D // Welcome to #ifdef HELL! :D +// + +#if SDL_MODERN +static SDL_Window* g_window; +static SDL_GLContext g_ctx; +#endif static bool g_fullscreen; - static unsigned g_interval; + void sdlwrap_set_swap_interval(unsigned interval, bool inited) { g_interval = interval; #if SDL_MODERN - SDL_GL_SetSwapInterval(g_interval); + if (g_window) + SDL_GL_SetSwapInterval(g_interval); #else if (inited) { @@ -80,9 +87,6 @@ bool sdlwrap_init(void) } #if SDL_MODERN -static SDL_Window* g_window; -static SDL_GLContext g_ctx; - void sdlwrap_destroy(void) { if (g_ctx)