diff --git a/src/globals.cpp b/src/globals.cpp index ddbe109..85eb918 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -1,4 +1,7 @@ SDL_Window *SDLWindow; +SDL_GLContext SDL_WindowGLContext; +SDL_Cursor *SDL_MouseCursor; +SDL_SystemCursor SDL_MouseCursorLastID; bool IsInFullscreen; int FullScreenSizeX, FullScreenSizeY; int FullScreenPositionX, FullScreenPositionY; diff --git a/src/text_editor.cpp b/src/text_editor.cpp index 1e44dab..80d6a9e 100644 --- a/src/text_editor.cpp +++ b/src/text_editor.cpp @@ -159,8 +159,6 @@ void SetMouseCursor(SDL_SystemCursor id) { } } #else -SDL_Cursor *SDL_MouseCursor; -SDL_SystemCursor SDL_MouseCursorLastID; void SetMouseCursor(SDL_SystemCursor id) { if (SDL_MouseCursor == NULL || SDL_MouseCursorLastID != id) { if (SDL_MouseCursor != NULL) { @@ -1014,8 +1012,8 @@ int main(int argc, char **argv, char **envp) } SDL_SetWindowPosition(SDLWindow, xhalf, yhalf); - SDL_GLContext gl_context = SDL_GL_CreateContext(SDLWindow); - SDL_GL_MakeCurrent(SDLWindow, gl_context); + SDL_WindowGLContext = SDL_GL_CreateContext(SDLWindow); + SDL_GL_MakeCurrent(SDLWindow, SDL_WindowGLContext); SDL_ShowWindow(SDLWindow); // Set icon