Optimizations without hardware acceleration

i just have a quick question about getting my sdl application to run as
fast as possible without hardware acceleration. should i run my
application in whatever bpp the user already has their computer in? like
if i’m running x11 at 32bpp, i shouldnt run my sdl app as a 16bpp
window, but as a 32bpp window, for more speed, right?

also, at least under x11, if you go fullscreen, does it change the bpp?
i run my x session at 1280x1024x32, but if i run my sdl app at
800x600x16, will i still be doing 16->32bpp conversions, or does x11
switch into the correct video mode? (i assume x11 and win32 act the same
way with windowed/fullscreen bpp conversions)

thanks, just wondering if somebody could clear that up, thanks.

– chris (@Christopher_Thielen)

Chris Thielen wrote:

i just have a quick question about getting my sdl application to run as
fast as possible without hardware acceleration. should i run my
application in whatever bpp the user already has their computer in? like
if i’m running x11 at 32bpp, i shouldnt run my sdl app as a 16bpp
window, but as a 32bpp window, for more speed, right?

also, at least under x11, if you go fullscreen, does it change the bpp?
i run my x session at 1280x1024x32, but if i run my sdl app at
800x600x16, will i still be doing 16->32bpp conversions, or does x11
switch into the correct video mode? (i assume x11 and win32 act the same
way with windowed/fullscreen bpp conversions)

thanks, just wondering if somebody could clear that up, thanks.

Using SDL_SetVideoMode() you can try to set any screen size and depth
that you want. But, there is no guarantee that you will get what you ask
for… That means that you always have to be ready to accept what ever
video modes are available. So, yes, you should be ready to deal with any
video mode and you should adapt your graphics code to work in the same
format as the video mode you got. The cost of converting each pixel you
draw to another format can be much greater than the cost of drawing the
pixels in the first place.

So the rules are:

  1. ask for what you prefer
  2. live with what you got
  3. work with what you have

It is a good idea to convert all your art to work with the format you
have to. Spending the time converting the art when you load it will save
rendering time and can save memory. It is actually a good idea to
convert the art work to several forms and just inculde all the forms of
the art in your game. That way you can just use the pre-converted art
and not have to pay the cost of converting it when you load it.

	Bob Pendleton> 

– chris (chris at luethy.net)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

Alright. But if I’m running on a 32bpp X server, obviously an SDL
windowed app would run best at 32bpp, but if I request 16bpp fullscreen,
and I get it, 16bpp would be fastest, correct?

– chris (@Christopher_Thielen)On Sat, 2002-10-05 at 20:19, Bob Pendleton wrote:

Chris Thielen wrote:

i just have a quick question about getting my sdl application to run as
fast as possible without hardware acceleration. should i run my
application in whatever bpp the user already has their computer in? like
if i’m running x11 at 32bpp, i shouldnt run my sdl app as a 16bpp
window, but as a 32bpp window, for more speed, right?

also, at least under x11, if you go fullscreen, does it change the bpp?
i run my x session at 1280x1024x32, but if i run my sdl app at
800x600x16, will i still be doing 16->32bpp conversions, or does x11
switch into the correct video mode? (i assume x11 and win32 act the same
way with windowed/fullscreen bpp conversions)

thanks, just wondering if somebody could clear that up, thanks.

Using SDL_SetVideoMode() you can try to set any screen size and depth
that you want. But, there is no guarantee that you will get what you ask
for… That means that you always have to be ready to accept what ever
video modes are available. So, yes, you should be ready to deal with any
video mode and you should adapt your graphics code to work in the same
format as the video mode you got. The cost of converting each pixel you
draw to another format can be much greater than the cost of drawing the
pixels in the first place.

So the rules are:

  1. ask for what you prefer
  2. live with what you got
  3. work with what you have

It is a good idea to convert all your art to work with the format you
have to. Spending the time converting the art when you load it will save
rendering time and can save memory. It is actually a good idea to
convert the art work to several forms and just inculde all the forms of
the art in your game. That way you can just use the pre-converted art
and not have to pay the cost of converting it when you load it.

  Bob Pendleton

– chris (@Christopher_Thielen)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Chris Thielen wrote:

Alright. But if I’m running on a 32bpp X server, obviously an SDL
windowed app would run best at 32bpp, but if I request 16bpp fullscreen,
and I get it, 16bpp would be fastest, correct?

Of course, ask for what you want. And use it if you get it. It will be
faster than using a different depth and having to convert every pixel
before it is displayed.

Just always be prepared to get a depth you don’t want. :slight_smile:

	Bob Pendleton> 

– chris (chris at luethy.net)

On Sat, 2002-10-05 at 20:19, Bob Pendleton wrote:

Chris Thielen wrote:

i just have a quick question about getting my sdl application to run as
fast as possible without hardware acceleration. should i run my
application in whatever bpp the user already has their computer in? like
if i’m running x11 at 32bpp, i shouldnt run my sdl app as a 16bpp
window, but as a 32bpp window, for more speed, right?

also, at least under x11, if you go fullscreen, does it change the bpp?
i run my x session at 1280x1024x32, but if i run my sdl app at
800x600x16, will i still be doing 16->32bpp conversions, or does x11
switch into the correct video mode? (i assume x11 and win32 act the same
way with windowed/fullscreen bpp conversions)

thanks, just wondering if somebody could clear that up, thanks.

Using SDL_SetVideoMode() you can try to set any screen size and depth
that you want. But, there is no guarantee that you will get what you ask
for… That means that you always have to be ready to accept what ever
video modes are available. So, yes, you should be ready to deal with any
video mode and you should adapt your graphics code to work in the same
format as the video mode you got. The cost of converting each pixel you
draw to another format can be much greater than the cost of drawing the
pixels in the first place.

So the rules are:

  1. ask for what you prefer
  2. live with what you got
  3. work with what you have

It is a good idea to convert all your art to work with the format you
have to. Spending the time converting the art when you load it will save
rendering time and can save memory. It is actually a good idea to
convert the art work to several forms and just inculde all the forms of
the art in your game. That way you can just use the pre-converted art
and not have to pay the cost of converting it when you load it.

  Bob Pendleton

– chris (chris at luethy.net)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------+

Alright. But if I’m running on a 32bpp X server, obviously an SDL
windowed app would run best at 32bpp, but if I request 16bpp fullscreen,
and I get it, 16bpp would be fastest, correct?

Nope, X11 can’t switch depths on the fly, unless you’re using the DGA driver.
Pass in the SDL_ANYFORMAT flag to SDL_SetVideoMode() and see what you actually
get. :slight_smile:

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment