Changeset 83b5b4b in opengl-game for opengl-game.cpp


Ignore:
Timestamp:
Oct 4, 2019, 8:19:15 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
0b1b52d
Parents:
5b02676
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (10/04/19 20:16:22)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (10/04/19 20:19:15)
Message:

Handle window resize events in openglgame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • opengl-game.cpp

    r5b02676 r83b5b4b  
    55#include "consts.hpp"
    66#include "logger.hpp"
     7
     8#include "utils.hpp"
    79
    810using namespace std;
     
    6668   }
    6769
     70   viewport = { 0, 0, gui->getWindowWidth(), gui->getWindowHeight() };
     71
    6872   cout << "Target window size: (" << width << ", " << height << ")" << endl;
    69    cout << "Actual window size: (" << gui->getWindowWidth() << ", " << gui->getWindowHeight() << ")" << endl;
     73   cout << "Actual window size: (" << viewport.width << ", " << viewport.height << ")" << endl;
    7074
    7175   return RTWO_SUCCESS;
     
    141145            case UI_EVENT_WINDOWRESIZE:
    142146               cout << "Window resize event detected" << endl;
     147               viewport.width = e.windowResize.width;
     148               viewport.height = e.windowResize.height;
    143149               break;
    144150            default:
Note: See TracChangeset for help on using the changeset viewer.