Changeset b6e60b4 in opengl-game for vulkan-game.cpp


Ignore:
Timestamp:
Sep 3, 2019, 7:11:36 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
ed7c953
Parents:
7fc5e27
Message:

In vulkangame and openglgame:

  • use int instead of usigned int for width and heights paremters
  • Fix a bug where GUI_FLAGS_WINDOW_FULLSCREEN was being incorrectly checked
  • Print the size of a window after it has been created
File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r7fc5e27 rb6e60b4  
    1818}
    1919
    20 void VulkanGame::run(unsigned int width, unsigned int height, unsigned char guiFlags) {
     20void VulkanGame::run(int width, int height, unsigned char guiFlags) {
    2121   if (initWindow(width, height, guiFlags) == RTWO_ERROR) {
    2222      return;
    2323   }
     24
    2425   initVulkan();
    2526   mainLoop();
     
    2728}
    2829
    29 bool VulkanGame::initWindow(unsigned int width, unsigned int height, unsigned char guiFlags) {
     30bool VulkanGame::initWindow(int width, int height, unsigned char guiFlags) {
    3031   gui = new GameGui_SDL();
    3132
    32    if (gui->Init() == RTWO_ERROR) {
     33   if (gui->init() == RTWO_ERROR) {
    3334      cout << "UI library could not be initialized!" << endl;
    34       cout << gui->GetError() << endl;
     35      cout << gui->getError() << endl;
    3536      return RTWO_ERROR;
    3637   }
    37    cout << "GUI init succeeded" << endl;
    3838
    39    window = (SDL_Window*) gui->CreateWindow("Vulkan Game", width, height, guiFlags | GUI_FLAGS_WINDOW_FULLSCREEN);
     39   window = (SDL_Window*) gui->createWindow("Vulkan Game", width, height, guiFlags & GUI_FLAGS_WINDOW_FULLSCREEN);
    4040   if (window == nullptr) {
    4141      cout << "Window could not be created!" << endl;
    4242      return RTWO_ERROR;
    4343   }
     44
     45   int actualWidth, actualHeight;
     46   gui->getWindowSize(&actualWidth, &actualHeight);
     47
     48   cout << "Target window size: (" << width << ", " << height << ")" << endl;
     49   cout << "Actual window size: (" << actualWidth << ", " << actualHeight << ")" << endl;
    4450
    4551   return RTWO_SUCCESS;
     
    6975
    7076void VulkanGame::cleanup() {
    71    gui->DestroyWindow();
    72    gui->Shutdown();
     77   gui->destroyWindow();
     78   gui->shutdown();
    7379   delete gui;
    7480}
Note: See TracChangeset for help on using the changeset viewer.