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

SDL help

Started by JakkeZ Sep 16, 2005 at 7:22 AM 0 replies 350+ views
Original Post
JakkeZ
JakkeZ
How can I make SDL_Flip and / or SDL_UpdateRect NOT wait for v-sync?
Drew_Benton
Drew_Benton
Disable VSync on the computer.

SDL currently relies on DirectX, so when you trace throgh all the source to see where it waites for vsync, you get this:
static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface){	HRESULT result;	LPDIRECTDRAWSURFACE3 dd_surface;	dd_surface = surface->hwdata->dd_surface;	/* to prevent big slowdown on fast computers, wait here instead of driver ring 0 code */	/* Dmitry Yakimov (ftech@tula.net) */	while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);	result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);	if ( result == DDERR_SURFACELOST ) {		result = IDirectDrawSurface3_Restore(						surface->hwdata->dd_surface);		while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);		result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);	}	if ( result != DD_OK ) {		SetDDerror("DirectDrawSurface3::Flip", result);		return(-1);	}	return(0);}

Topic Locked

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

Sign in to reply to this topic.