diff options
| author | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-08 06:49:24 +0000 |
|---|---|---|
| committer | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-08 06:49:24 +0000 |
| commit | edf4f6f6883b8bf54a7839987044842684e5a66e (patch) | |
| tree | 869a2244788e6cc63de74c6d9afcb5a13e4cac70 /Source/GameInitDispose.cpp | |
| parent | 79fb7cbf3ee035f05471b75697f526740e24b2a4 (diff) | |
| download | blackshades-edf4f6f6883b8bf54a7839987044842684e5a66e.tar.gz | |
added sdl init
git-svn-id: svn://svn.icculus.org/blackshades/trunk@42 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/GameInitDispose.cpp')
| -rw-r--r-- | Source/GameInitDispose.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index f6e642c..76b0f32 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -3774,7 +3774,32 @@ int Game::InitGL(GLvoid) return; #else - STUB_FUNCTION; + if (SDL_Init(SDL_INIT_VIDEO) == -1) { + fprintf(stderr, "SDL Init Video failed: %s\n", SDL_GetError()); + exit(EXIT_FAILURE); + } + + atexit(SDL_Quit); + + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + + if(screenwidth<640||screenheight<480) { + if (SDL_SetVideoMode(640, 480, 0, SDL_OPENGL) == NULL) { + fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError()); + exit(EXIT_FAILURE); + } + } else { + if (SDL_SetVideoMode(screenwidth, screenheight, 0, SDL_OPENGL) == NULL) { + fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError()); + exit(EXIT_FAILURE); + } + } + + SDL_WM_SetCaption("Black Shades", "Black Shades"); #endif |
