Skip to content

Commit

Permalink
Wrap GPU_Init call in an #ifdef.
Browse files Browse the repository at this point in the history
  • Loading branch information
lipk committed Jul 5, 2014
1 parent 0798557 commit df13478
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video.cpp
Expand Up @@ -343,12 +343,21 @@ CVideo::CVideo(FAKE_TYPES type) : mode_changed_(false), bpp_(0), fake_screen_(fa

void CVideo::initSDL()
{
#ifdef SDL_GPU
render_target = GPU_Init(1200, 700, GPU_DEFAULT_INIT_FLAGS);

if(render_target == NULL) {
ERR_DP << "Could not initialize window: " << SDL_GetError() << std::endl;
throw CVideo::error();
}
#else
const int res = SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);

if(res < 0) {
ERR_DP << "Could not initialize SDL_video: " << SDL_GetError() << std::endl;
throw CVideo::error();
}
#endif
}

CVideo::~CVideo()
Expand Down

0 comments on commit df13478

Please sign in to comment.