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 8e80bd38a..ab9d0d07f 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,34 +765,13 @@ - (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) { - [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); } @@ -1365,8 +1343,6 @@ - (void) initialiseGLWithSize:(NSSize) v_size [[self gameController] setUpBasicOpenGLStateWithSize:pixelSize]; SDL_GL_SwapWindow(window); squareX = 0.0f; - - m_glContextInitialized = YES; }