Mercurial > sdl-ios-xcode
diff test/testgl.c @ 1912:8d384b647307
Setting up the OpenGL support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 16 Jul 2006 09:34:01 +0000 |
parents | c121d94672cb |
children | c785543d1843 |
line wrap: on
line diff
--- a/test/testgl.c Sun Jul 16 03:35:44 2006 +0000 +++ b/test/testgl.c Sun Jul 16 09:34:01 2006 +0000 @@ -457,16 +457,16 @@ if (accel) { SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); } - if (sync) { - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); - } else { - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0); - } if (SDL_SetVideoMode(w, h, bpp, video_flags) == NULL) { fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); SDL_Quit(); exit(1); } + if (sync) { + SDL_GL_SetSwapInterval(1); + } else { + SDL_GL_SetSwapInterval(0); + } printf("Screen BPP: %d\n", SDL_GetVideoSurface()->format->BitsPerPixel); printf("\n"); @@ -498,8 +498,8 @@ printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); } if (sync) { - SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &value); - printf("SDL_GL_SWAP_CONTROL: requested 1, got %d\n", value); + printf("Buffer swap interval: requested 1, got %d\n", + SDL_GL_GetSwapInterval()); } /* Set the window manager title bar */