diff options
Diffstat (limited to 'pyramid.cpp')
-rw-r--r-- | pyramid.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/pyramid.cpp b/pyramid.cpp index 76bf89e..dcb40c0 100644 --- a/pyramid.cpp +++ b/pyramid.cpp @@ -36,7 +36,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 SetupRC() @@ -302,9 +302,15 @@ 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); @@ -359,7 +365,7 @@ int main(int argc, char **argv) #ifdef STAT_FPS deltaclock = SDL_GetTicks() - startclock; if (deltaclock != 0 ) - current_fps = 1000 / deltaclock; + current_fps = 1000 / deltaclock; static char buffer[30] = { 0 }; sprintf(buffer, "Textured Pyramid: %04d fps", current_fps); |