I just noticed you unlock your surface after flipping. The doc
project says to not call SDL_UpdateRect() if the surface is
locked, and i’m guessing the same applies to flipping. Does
unlocking before flipping fix the problem?
**If ClearScreen() calls SDL_FillRect, the surface doesn’t have
to be locked at that point.
If unlocking didn’t work;
a)Are you getting a valid video surface?
b)does DrawRotated() work when doublebuffering is not enabled?
//code to initialize SDL, set a video mode, and check if it
worked
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
cerr << "Couldn’t initialize sdl: " << SDL_GetError() <<
endl;
SDL_Quit();
return -1;
}
screen = SDL_SetVideoMode(SCREEN_W, SCREEN_H, screen_bpp,
SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);
if(screen == NULL)
{
cerr << "Couldn’t set " << SCREEN_W << “x” << SCREEN_H <<
“x” << screen_bpp
<< " video mode " << endl << SDL_GetError() << endl;
//could try at a lower setting, or quit
SDL_Quit();
return -1;
}
//enter game/render loop
SDL_Quit();
— join at krakendev.com wrote:> Yeah. My current Draw function is as follows:
void BSDL::DrawScene()
{
Slock(screen);
ClearScreen();
DrawRotated((int)angle,1);
SDL_Flip(screen);
Sulock(screen);
}
DrawRotated just uses BlitSurface.
The other pertinent functions are:
void BSDL::Slock(SDL_Surface *screen)
{
if ( SDL_MUSTLOCK(screen) )
{
if ( SDL_LockSurface(screen) < 0 )
{
return;
}
}
}
void BSDL::Sulock(SDL_Surface *screen)
{
if ( SDL_MUSTLOCK(screen) )
{
SDL_UnlockSurface(screen);
}
}
I’m just going by the tutorial’s example, but that seems
correct (though
obviously I’m making a mistake somewhere). Cheers.
----- Original Message -----
From: “jake b” <@jake_b>
To: "A list for developers using the SDL library. (includes
SDL-announce)"
Sent: Sunday, June 06, 2004 5:02 PM
Subject: Re: [SDL] SDL Fullscreen Problems
— join at krakendev.com wrote:
Erg, sorry. Correction:
Well, I can get SWSURFACE and FULLSCREEN working, but when
I
add DOUBLEBUF
I just get black. I’m not really sure what’s up. Cheers.
If doublebuffering is enabled, you need to flip surfaces,
instead of updating.
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.