Changeset d5f2b42 in opengl-game for game-gui-sdl.cpp


Ignore:
Timestamp:
Aug 30, 2019, 7:25:55 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
d8cb15e
Parents:
d02c25f
Message:

Create a generic GetError() function in game-gui that returns the last error returned by a call to some other function in game-gui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-sdl.cpp

    rd02c25f rd5f2b42  
    11#include "game-gui-sdl.hpp"
     2
     3string GameGui_SDL::s_errorMessage;
     4
     5string& GameGui_SDL::GetError() {
     6   GameGui_SDL::s_errorMessage = SDL_GetError();
     7
     8   return GameGui_SDL::s_errorMessage;
     9}
    210
    311bool GameGui_SDL::Init() {
     
    513   // prevents SDL from setting up its own handlers for SIG_SEGV and stuff like that
    614
    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";
    916
    10    // cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << endl;
    11 
    12    // TODO: Print out contextual error messages instead of just returning
    1317   if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
    1418      return RTWO_ERROR;
Note: See TracChangeset for help on using the changeset viewer.