Setting up the OpenGL support
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401957
This commit is contained in:
parent
89484fea07
commit
2eed452d04
7 changed files with 256 additions and 116 deletions
|
@ -457,16 +457,16 @@ RunGLTest(int argc, char *argv[],
|
|||
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 @@ RunGLTest(int argc, char *argv[],
|
|||
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue