• Create Account

## SDL Fullscreen

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1Erondial  Members

Posted 05 November 2007 - 08:21 AM

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?

### #2bombinator-dev  Members

Posted 05 November 2007 - 03:31 PM

Check to make sure you are actually getting a hardware surface back. My gut tells me you are getting a software surface in full screen.

### #3Erondial  Members

Posted 05 November 2007 - 06:00 PM

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?

### #4Kylotan  Moderators

Posted 05 November 2007 - 10:44 PM

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?

### #5Erondial  Members

Posted 07 November 2007 - 10:47 AM

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.

### #6Inmate2993  Members

Posted 07 November 2007 - 06:49 PM

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.

### #7Kylotan  Moderators

Posted 07 November 2007 - 10:26 PM

Quote:
 Original post by ErondialWell, 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. :)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.