Changeset 5f3dba8 in opengl-game for game-gui-sdl.cpp


Ignore:
Timestamp:
Aug 12, 2019, 3:45:20 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
e1a7f5a
Parents:
69dccfe
Message:

Create a transparent texture in SDL and render some sample images and shapes onto it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-sdl.cpp

    r69dccfe r5f3dba8  
    1010   // cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << endl;
    1111
    12    return SDL_Init(SDL_INIT_EVERYTHING) < 0 ? RTWO_ERROR : RTWO_SUCCESS;
     12   // TODO: Print out contextual error messages instead of just returning
     13   if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
     14      return RTWO_ERROR;
     15   }
     16
     17   int imgFlags = IMG_INIT_PNG;
     18   if (!(IMG_Init(imgFlags) & imgFlags)) {
     19      return RTWO_ERROR;
     20   }
     21
     22   if (TTF_Init() == -1) {
     23      return RTWO_ERROR;
     24   }
     25
     26   return RTWO_SUCCESS;
    1327}
    1428
Note: See TracChangeset for help on using the changeset viewer.