• Advertisement
Sign in to follow this  

SDL Fullscreen

This topic is 3729 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been looking around on the net, and I've found a few references to this, nothing substantial though, the main case that's similar to mine is noted in MPlayer's old update log, but it doesn't say how they fixed it. So, I put it to you guys: I'm writing an SDL video player. I've got everything working, it's all very nice indeed. However, I hit a small snag when I try to run it in fullscreen. It's unbelievably slow. I have it set at 1600x1200 resolution, which runs absolutely fine in windowed mode, no problems, but the second I switch it to fullscreen, the FPS drops to like 10.
if (Fullscreen)
   Screen = SDL_SetVideoMode(Width, Height, 24, SDL_FULLSCREEN | SDL_HWSURFACE);
else
   Screen = SDL_SetVideoMode(Width, Height, 24, SDL_HWSURFACE | SDL_NOFRAME);
That's how I'm initializing my surfaces. I'm displaying things using a YUV overlay. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
http://www.linuxdevcenter.com/pub/a/linux/2003/08/07/sdl_anim.html

Well, I looked at that, and tried:

if (0 == Screen->flags & SDL_HWSURFACE)
MessageBox(NULL,"No hardware surface.",".",MB_OK);

Interestingly enough, this doesn't seem to work. Nothing happens, but not just for normal operations, when I specify SDL_SWSURFACE, I still get nothing. The code's being run, MessageBox works (I tested), but no matter what I do, I can't seem to get this code to trigger. Is there any other way to determine whether I have a hardware surface?

Share this post


Link to post
Share on other sites
This will be better in the Alternative Game Libraries forum, so I'll move it.

Are you sure the overlay uses the same pixel format as the screen you end up with?

Share this post


Link to post
Share on other sites
Well, no, it doesn't, it uses a YUV pixel format, whereas the display I'm using uses an RGB display. But they're both 24 bits, if that's what you're asking. I think SDL_DisplayYUVOverlay converts from whatever format the overlay's in to the format of the destination screen. The format is SDL_YV12_OVERLAY.

Share this post


Link to post
Share on other sites
SDL may have given you a shadow surface. Use SDL_GetVideoInfo and SDL_ListModes before hand to make sure you are getting the actual surface you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by Erondial
Well, no, it doesn't, it uses a YUV pixel format, whereas the display I'm using uses an RGB display. But they're both 24 bits, if that's what you're asking.


I was asking a retarded question, please ignore me. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement