Move to globals SDL vars

This commit is contained in:
Krzosa Karol
2026-03-21 10:22:31 +01:00
parent 94ee03800d
commit fadf4cd698
2 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
SDL_Window *SDLWindow; SDL_Window *SDLWindow;
SDL_GLContext SDL_WindowGLContext;
SDL_Cursor *SDL_MouseCursor;
SDL_SystemCursor SDL_MouseCursorLastID;
bool IsInFullscreen; bool IsInFullscreen;
int FullScreenSizeX, FullScreenSizeY; int FullScreenSizeX, FullScreenSizeY;
int FullScreenPositionX, FullScreenPositionY; int FullScreenPositionX, FullScreenPositionY;

View File

@@ -159,8 +159,6 @@ void SetMouseCursor(SDL_SystemCursor id) {
} }
} }
#else #else
SDL_Cursor *SDL_MouseCursor;
SDL_SystemCursor SDL_MouseCursorLastID;
void SetMouseCursor(SDL_SystemCursor id) { void SetMouseCursor(SDL_SystemCursor id) {
if (SDL_MouseCursor == NULL || SDL_MouseCursorLastID != id) { if (SDL_MouseCursor == NULL || SDL_MouseCursorLastID != id) {
if (SDL_MouseCursor != NULL) { if (SDL_MouseCursor != NULL) {
@@ -1014,8 +1012,8 @@ int main(int argc, char **argv, char **envp)
} }
SDL_SetWindowPosition(SDLWindow, xhalf, yhalf); SDL_SetWindowPosition(SDLWindow, xhalf, yhalf);
SDL_GLContext gl_context = SDL_GL_CreateContext(SDLWindow); SDL_WindowGLContext = SDL_GL_CreateContext(SDLWindow);
SDL_GL_MakeCurrent(SDLWindow, gl_context); SDL_GL_MakeCurrent(SDLWindow, SDL_WindowGLContext);
SDL_ShowWindow(SDLWindow); SDL_ShowWindow(SDLWindow);
// Set icon // Set icon