From 427e103aaaadf53225d372d6d803943a7861262e Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 22 Aug 2026 15:59:36 +1200 Subject: [PATCH 1/3] updateScreen simplify - works on Windows --- src/SDL/MyOpenGLView.m | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index 8e80bd38a..9b9dc281b 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -766,24 +766,11 @@ - (NSSize) modeAsSize:(int)sizeIndex - (void) updateScreen { - SDL_SetWindowSize(window, (int)viewSize.width, (int)viewSize.height); - SDL_Surface* surface = SDL_GetWindowSurface(window); - int windowWidth, windowHeight; - SDL_GetWindowSize(window, &windowWidth, &windowHeight); - if ((viewSize.width != windowWidth)||(viewSize.height != windowHeight)) // resized - { - viewSize.width = windowWidth; - viewSize.height = windowHeight; - } - if (m_glContextInitialized == NO) { [self initialiseGLWithSize:viewSize]; } - if (surface == 0) - return; - // do all the drawing! // if (UNIVERSE) From c17c5f5e20bdb23b99dd131db29bd7fcbe2e26ba Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 22 Aug 2026 16:10:52 +1200 Subject: [PATCH 2/3] remove m_glContextInitialized - works on Windows --- src/SDL/MyOpenGLView.h | 1 - src/SDL/MyOpenGLView.m | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/SDL/MyOpenGLView.h b/src/SDL/MyOpenGLView.h index e3eaabfa7..bd594d917 100644 --- a/src/SDL/MyOpenGLView.h +++ b/src/SDL/MyOpenGLView.h @@ -184,7 +184,6 @@ extern int debug; int keycodetrans[255]; - BOOL m_glContextInitialized; NSPoint mouseDragStartPoint; BOOL mouseWarped; diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index 9b9dc281b..26bc8064a 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -468,8 +468,6 @@ - (id) init _mouseWheelDelta = 0.0f; - m_glContextInitialized = NO; - return self; } @@ -523,6 +521,7 @@ - (void) endSplashScreen */ } + [self initialiseGLWithSize:firstScreen]; [self updateScreen]; [self autoShowMouse]; } @@ -766,11 +765,6 @@ - (NSSize) modeAsSize:(int)sizeIndex - (void) updateScreen { - if (m_glContextInitialized == NO) - { - [self initialiseGLWithSize:viewSize]; - } - // do all the drawing! // if (UNIVERSE) @@ -1352,8 +1346,6 @@ - (void) initialiseGLWithSize:(NSSize) v_size [[self gameController] setUpBasicOpenGLStateWithSize:pixelSize]; SDL_GL_SwapWindow(window); squareX = 0.0f; - - m_glContextInitialized = YES; } From f72129b2ffa3dff112f9e301903cdcced2b52c8f Mon Sep 17 00:00:00 2001 From: mcarans Date: Sun, 23 Aug 2026 10:15:33 +1200 Subject: [PATCH 3/3] Move comments --- src/SDL/MyOpenGLView.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/SDL/MyOpenGLView.m b/src/SDL/MyOpenGLView.m index 26bc8064a..ab9d0d07f 100644 --- a/src/SDL/MyOpenGLView.m +++ b/src/SDL/MyOpenGLView.m @@ -765,16 +765,13 @@ - (NSSize) modeAsSize:(int)sizeIndex - (void) updateScreen { - // do all the drawing! - // if (UNIVERSE) { - [UNIVERSE drawUniverse]; + [UNIVERSE drawUniverse]; // do all the drawing! } else { - // not set up yet, draw a black screen - glClearColor( 0.0, 0.0, 0.0, 0.0); + glClearColor( 0.0, 0.0, 0.0, 0.0); // not set up yet, draw a black screen glClear( GL_COLOR_BUFFER_BIT); }