Skip to content
Permalink
Browse files

drop extra resize calls. The windows is created only once.

  • Loading branch information...
atupone committed May 1, 2018
1 parent 1fa9934 commit 0cceded9300497660af13736ca497eaa9aff9717
Showing with 4 additions and 6 deletions.
  1. +0 −4 src/bzflag/MainWindow.cxx
  2. +2 −0 src/bzflag/bzflag.cxx
  3. +2 −2 src/platform/SDL2Window.cxx
@@ -37,7 +37,6 @@ MainWindow::MainWindow(BzfWindow* _window, BzfJoystick* _joystick) :
faulting(false)
{
window->addResizeCallback(resizeCB, this);
resize();
}

MainWindow::~MainWindow()
@@ -50,7 +49,6 @@ void MainWindow::setMinSize(int _minWidth, int _minHeight)
minWidth = _minWidth;
minHeight = _minHeight;
window->setMinSize(minWidth, minHeight);
resize();
}

void MainWindow::setPosition(int x, int y)
@@ -61,7 +59,6 @@ void MainWindow::setPosition(int x, int y)
void MainWindow::setSize(int _width, int _height)
{
window->setSize(_width, _height);
resize();
}

void MainWindow::showWindow(bool on)
@@ -158,7 +155,6 @@ void MainWindow::toggleFullscreen()
{
isFullscreen = !isFullscreen;
window->setFullscreen(isFullscreen);
resize();
}

void MainWindow::setFullView(bool _isFullView)
@@ -1111,6 +1111,8 @@ int main(int argc, char** argv)
// enable vsync if needed
pmainWindow->getWindow()->setVerticalSync(BZDB.evalInt("saveEnergy") == 2);

// Make sure the window is created
pmainWindow->getWindow()->callResizeCallbacks();
// initialize graphics state
pmainWindow->getWindow()->makeCurrent();
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
@@ -337,11 +337,11 @@ void SDLWindow::setVerticalSync(bool setting) {
}

void SDLWindow::setMinSize(int width, int height) {
min_width = width;
min_height = height;
if (!windowId)
return;
SDL_SetWindowMinimumSize (windowId, width, height);
min_width = width;
min_height = height;
}

void SDLWindow::makeCurrent() {

0 comments on commit 0cceded

Please sign in to comment.
You can’t perform that action at this time.