SDL Forum Index
SDL
Simple DirectMedia Layer Forums
Reply to topic
osx fullscreen sw vs hw
jon
Guest

Reply with quote
To set the fullscreen mode in my game I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);

whereas for windowed mode I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_SWSURFACE |
SDL_RESIZABLE);

On windows and linux both fullscreen and windowed mode work fine, but on
osx 10.6 only windowed mode looks fine. In fullscreen mode I get weird
colors: http://www.cs.utah.edu/~rafkind/tmp/paintown/ss.png

Is SDL_SWSURFACE recommended in fullscreen mode? I'm using SDL 1.2.14.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
osx fullscreen sw vs hw
Jonny D


Joined: 12 Sep 2009
Posts: 713
Reply with quote
Software surfaces should be fine to use anywhere... and that looks like a fun game.

Jonny D


On Tue, Dec 21, 2010 at 3:18 PM, jon wrote:
Quote:
To set the fullscreen mode in my game I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);

whereas for windowed mode I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_SWSURFACE |
SDL_RESIZABLE);

On windows and linux both fullscreen and windowed mode work fine, but on
osx 10.6 only windowed mode looks fine. In fullscreen mode I get weird
colors: http://www.cs.utah.edu/~rafkind/tmp/paintown/ss.png

Is SDL_SWSURFACE recommended in fullscreen mode? I'm using SDL 1.2.14.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
View user's profileSend private messageVisit poster's website
osx fullscreen sw vs hw
Patrice Mandin
Guest

Reply with quote
Le Tue, 21 Dec 2010 13:18:00 -0700
jon a écrit:

Quote:
To set the fullscreen mode in my game I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);

whereas for windowed mode I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_SWSURFACE |
SDL_RESIZABLE);

On windows and linux both fullscreen and windowed mode work fine, but on
osx 10.6 only windowed mode looks fine. In fullscreen mode I get weird
colors: http://www.cs.utah.edu/~rafkind/tmp/paintown/ss.png

Most likely you got a different organization for R,G,B,A storage in the
SDL_Surface.

Compare the values of the pixel format for the screen
SDL_Surface->format between fullscreen and windowed mode, and check
your drawings are properly done:
http://wiki.libsdl.org/moin.cgi/SDL_PixelFormat

--
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Spécialité: Développement, jeux

"who writes the code, decides"
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
osx fullscreen sw vs hw
jon
Guest

Reply with quote
On 12/21/2010 02:12 PM, Patrice Mandin wrote:
Quote:
Le Tue, 21 Dec 2010 13:18:00 -0700
jon a écrit:

Quote:
To set the fullscreen mode in my game I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);

whereas for windowed mode I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_SWSURFACE |
SDL_RESIZABLE);

On windows and linux both fullscreen and windowed mode work fine, but on
osx 10.6 only windowed mode looks fine. In fullscreen mode I get weird
colors: http://www.cs.utah.edu/~rafkind/tmp/paintown/ss.png
Most likely you got a different organization for R,G,B,A storage in the
SDL_Surface.

Compare the values of the pixel format for the screen
SDL_Surface->format between fullscreen and windowed mode, and check
your drawings are properly done:
http://wiki.libsdl.org/moin.cgi/SDL_PixelFormat


Seems that in fullscreen mode on osx I get RGB 5-5-5 whereas on every
other system (and windowed osx) I get 5-6-5. I had some routines that
secretly depended on getting 5-6-5 and they broke on the new format. Sigh..

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
osx fullscreen sw vs hw
jon
Guest

Reply with quote
On 12/22/2010 12:33 AM, jon wrote:
Quote:
On 12/21/2010 02:12 PM, Patrice Mandin wrote:
Quote:
Le Tue, 21 Dec 2010 13:18:00 -0700
jon a écrit:

Quote:
To set the fullscreen mode in my game I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);

whereas for windowed mode I call

screen = SDL_SetVideoMode(width, height, SCREEN_DEPTH, SDL_SWSURFACE |
SDL_RESIZABLE);

On windows and linux both fullscreen and windowed mode work fine, but on
osx 10.6 only windowed mode looks fine. In fullscreen mode I get weird
colors: http://www.cs.utah.edu/~rafkind/tmp/paintown/ss.png
Most likely you got a different organization for R,G,B,A storage in the
SDL_Surface.

Compare the values of the pixel format for the screen
SDL_Surface->format between fullscreen and windowed mode, and check
your drawings are properly done:
http://wiki.libsdl.org/moin.cgi/SDL_PixelFormat

Seems that in fullscreen mode on osx I get RGB 5-5-5 whereas on every
other system (and windowed osx) I get 5-6-5. I had some routines that
secretly depended on getting 5-6-5 and they broke on the new format. Sigh..

I think the solution to this is just to create all my memory bitmaps
with a custom 5-6-5 format, and rely on sdl to do the conversion to
5-5-5 when I blit to the screen. I realize that can be quite slow but
since most platforms give me 5-6-5 and its much easier not to change my
existing code, as well as not having to play fancy tricks when the
screen pixel format changes while the game is running, I think its the
best option.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
osx fullscreen sw vs hw
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic