Changeset 5edbd58 in opengl-game for opengl-game.cpp


Ignore:
Timestamp:
Sep 2, 2019, 5:23:40 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
301d0d4
Parents:
2beb6c7
Message:

For both openglgame and vulkangame, pass in the window width and height and a fullscreen flag to the run() function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • opengl-game.cpp

    r2beb6c7 r5edbd58  
    22
    33#include <iostream>
     4
     5#include "consts.hpp"
    46
    57#include "game-gui-glfw.hpp"
     
    1517}
    1618
    17 void OpenGLGame::run() {
    18    if (initWindow() == RTWO_ERROR) {
     19void OpenGLGame::run(unsigned int width, unsigned int height, unsigned char guiFlags) {
     20   if (initWindow(width, height, guiFlags) == RTWO_ERROR) {
    1921      return;
    2022   }
     
    2426}
    2527
    26 bool OpenGLGame::initWindow() {
     28bool OpenGLGame::initWindow(unsigned int width, unsigned int height, unsigned char guiFlags) {
    2729   gui = new GameGui_GLFW();
    2830
     
    3436   cout << "GUI init succeeded" << endl;
    3537
    36    window = (GLFWwindow*) gui->CreateWindow("OpenGL Game", SCREEN_WIDTH, SCREEN_HEIGHT);
     38   window = (GLFWwindow*) gui->CreateWindow("OpenGL Game", width, height);
    3739   if (window == nullptr) {
    3840      cout << "Window could not be created!" << endl;
Note: See TracChangeset for help on using the changeset viewer.