Skip to main content
GameDev.net gamedev.net
🔒 Locked

DoubleBuffer (SDL)

Started by voss Mar 16, 2011 at 3:43 PM 1 replies 1.5k views
Original Post
voss
voss
Hi,

I noticed that SDL_Flip does not wait for vsync. Besides, SDL_VideoInfo returns hw_available = 0. How do I find out whether my grafic board (NVIDA GFORCE 9400GT) supports double buffering?

I used the followin command to set video mode:
monitor = SDL_SetVideoMode(MAXX, MAXY, 16, SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);

Is there a simple alternative to wait for an vsync?

best,
Andreas
rip-off
rip-off
Unless you explicitly tell SDL to use the right backend (e.g. directx on Windows) you will not get a hardware surface, nor will your program be vsynced or directly double buffered. This is done using the SDL_VIDEODRIVER environmental variable.
voss
voss
Great Thanks, that was quick and easy!

The following works with ms visual studio:

_putenv("SDL_VIDEODRIVER=directx");
SDL_Init(SDL_INIT_EVERYTHING);
monitor = SDL_SetVideoMode(MAXX, MAXY, 16, SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);

const SDL_VideoInfo *video = SDL_GetVideoInfo();
printf("hw: %d\n", video->hw_available);


Andreas

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.