Changeset 98f3232 in opengl-game


Ignore:
Timestamp:
Jul 11, 2019, 3:53:03 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
321272c
Parents:
f286a10
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (07/11/19 15:50:51)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (07/11/19 15:53:03)
Message:

Use GameGui as the base class for GameGui_SDL

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • game-gui-sdl.hpp

    rf286a10 r98f3232  
    1 //#include "game-gui.hpp"
     1#include "game-gui.hpp"
    22
    3 #define RTWO_SUCCESS true
    4 #define RTWO_ERROR false
    5 
    6 class GameGui_SDL {
     3class GameGui_SDL : public GameGui {
    74   public:
    85      bool Init();
  • game-gui.hpp

    rf286a10 r98f3232  
     1#define RTWO_SUCCESS true
     2#define RTWO_ERROR false
     3
    14class GameGui {
    25   public:
    3       virtual void Init();
    4       virtual void Shutdown();
     6      virtual ~GameGui() {};
     7
     8      virtual bool Init() = 0;
     9      virtual void Shutdown() = 0;
    510};
  • vulkan-game.cpp

    rf286a10 r98f3232  
    9191      }
    9292   private:
    93       GameGui_SDL gui;
     93      GameGui* gui = new GameGui_SDL();
    9494      SDL_Window* window = nullptr;
    9595
     
    106106      // both SDL and GLFW create window functions return NULL on failure
    107107      bool initWindow() {
    108          if (gui.Init() == RTWO_ERROR) {
     108         if (gui->Init() == RTWO_ERROR) {
    109109            cout << "UI library could not be initialized!" << endl;
    110110            return RTWO_ERROR;
     
    416416         SDL_DestroyWindow(window);
    417417
    418          gui.Shutdown();
     418         gui->Shutdown();
     419         delete gui;
    419420      }
    420421};
Note: See TracChangeset for help on using the changeset viewer.