diff options
author | Kyle K <kylek389@gmail.com> | 2011-01-17 04:45:08 -0600 |
---|---|---|
committer | Kamil Kaminski <kamilkss@gmail.com> | 2011-01-17 04:45:08 -0600 |
commit | 95fb08d84d8cbcc23f2ac03cd3a51debed34541f (patch) | |
tree | 489f7ad2b4a050e5354775f5657fcbb749fdaab4 /sdl | |
parent | a31748ade89121403e3e4aea04898cf48b996580 (diff) | |
download | GLPyramid-95fb08d84d8cbcc23f2ac03cd3a51debed34541f.tar.gz GLPyramid-95fb08d84d8cbcc23f2ac03cd3a51debed34541f.tar.bz2 GLPyramid-95fb08d84d8cbcc23f2ac03cd3a51debed34541f.zip |
sdl: fix blank screen in Windows XP
Diffstat (limited to 'sdl')
-rw-r--r-- | sdl/mingw32 | 2 | ||||
-rw-r--r-- | sdl/pyramid.c | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sdl/mingw32 b/sdl/mingw32 index a43c1ef..ff7555e 100644 --- a/sdl/mingw32 +++ b/sdl/mingw32 @@ -30,4 +30,4 @@ shader.o: shader.c shader.h math3d.h .PHONY: clean clean: - rm -f *.o ./$(PROG) + rm -f *.o ./$(PROG).exe diff --git a/sdl/pyramid.c b/sdl/pyramid.c index e08b426..265ffcd 100644 --- a/sdl/pyramid.c +++ b/sdl/pyramid.c @@ -1,6 +1,6 @@ /* pyramid.c * - * @2010 Kamil Kaminski + * @2011 Kamil Kaminski * * notes: since lighting is enabled, we need to specify normals for * each polygon face so the OpenGL can calculate e.g. how light reflects @@ -63,7 +63,7 @@ static void resize(int w, int h) glLoadIdentity(); /* this needs to be ran again, glut does it for you I suppose */ - SDL_SetVideoMode(w, h, 32, SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_RESIZABLE); + SDL_SetVideoMode(w, h, 32, SDL_OPENGL | SDL_RESIZABLE); } static void setup_opengl(void) @@ -302,8 +302,14 @@ int main(int argc, char **argv) atexit(SDL_Quit); SDL_WM_SetCaption("Textured Pyramid", NULL); - if ((screen = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL | SDL_GL_DOUBLEBUFFER - | SDL_RESIZABLE)) == NULL) + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); + + if ((screen = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL | SDL_RESIZABLE)) == NULL) { fprintf(stderr, "unable to set video mode: %s\n", SDL_GetError()); exit(-1); |