Changeset d5f2b42 in opengl-game
- Timestamp:
- Aug 30, 2019, 7:25:55 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- d8cb15e
- Parents:
- d02c25f
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
game-gui-sdl.cpp
rd02c25f rd5f2b42 1 1 #include "game-gui-sdl.hpp" 2 3 string GameGui_SDL::s_errorMessage; 4 5 string& GameGui_SDL::GetError() { 6 GameGui_SDL::s_errorMessage = SDL_GetError(); 7 8 return GameGui_SDL::s_errorMessage; 9 } 2 10 3 11 bool GameGui_SDL::Init() { … … 5 13 // prevents SDL from setting up its own handlers for SIG_SEGV and stuff like that 6 14 7 // If this function fails, I can call SDL_GetError() for more info 8 // I should create a generic error retrieval function, similar to SDL_GetError() 15 GameGui_SDL::s_errorMessage = "No error"; 9 16 10 // cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << endl;11 12 // TODO: Print out contextual error messages instead of just returning13 17 if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { 14 18 return RTWO_ERROR; -
game-gui-sdl.hpp
rd02c25f rd5f2b42 11 11 class GameGui_SDL : public GameGui { 12 12 public: 13 string& GetError(); 14 13 15 bool Init(); 14 16 void Shutdown(); … … 26 28 private: 27 29 SDL_Window* window; 30 31 static string s_errorMessage; 28 32 }; 29 33 -
game-gui.hpp
rd02c25f rd5f2b42 18 18 virtual ~GameGui() {}; 19 19 20 virtual string& GetError() = 0; 21 20 22 virtual bool Init() = 0; 21 23 virtual void Shutdown() = 0; -
vulkan-game.cpp
rd02c25f rd5f2b42 30 30 if (gui->Init() == RTWO_ERROR) { 31 31 cout << "UI library could not be initialized!" << endl; 32 cout << SDL_GetError() << endl;32 cout << gui->GetError() << endl; 33 33 return RTWO_ERROR; 34 34 }
Note:
See TracChangeset
for help on using the changeset viewer.