Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 31 lines (25 sloc) 0.772 kb
c1cb0cc Initial commit
Stefan Näwe authored
1 #include "SdlHardwareLayer.h"
2
3 #include "sdl.h"
4 #include "SdlLayerFactory.h"
5 #include "SdlLayerInstanceDelegator.h"
6
7 SdlHardwareLayer::SdlHardwareLayer() {
8 }
9
10 SdlHardwareLayer::~SdlHardwareLayer() {
11 }
12
13 void SdlHardwareLayer::initializeHardware() {
14 const SDL_version * sdlVersion = SdlLayerFactory::getInstance()->SDL_Linked_Version();
15 if (sdlVersion->minor < 2 && sdlVersion->major < 2) {
16 throw 1;
17 }
18 else if (SdlLayerFactory::getInstance()->SDL_Init(SDL_INIT_VIDEO |
19 SDL_INIT_AUDIO |
20 SDL_INIT_NOPARACHUTE) < 0) {
21 throw 2;
22 }
23 else {
24 m_screen = SDL_SetVideoMode(m_x, m_y, m_bitDepth, SDL_DOUBLEBUF);
25 if (0 != m_screen) {
26 SDL_WM_SetCaption(m_title.c_str(), 0);
27 }
28 }
29 }
30
Something went wrong with that request. Please try again.