Hw_surfaces

When you create a SDL_Surface on the HW_SURFACE is it actually on the
video card or does it use system memory? I believe this to be true,
which really leads me to my next question, If I convert more surfaces
with SDL_Convert does that also ‘put’ the surface on the HW_SURFACE? If
so then theoretically you can have as many surfaces as memory that the
card has.

Thanks,
Walt

As far as I know, if you use the HW_SURFACE option when
creating a new surface or initializing the screen, SDL will
attempt to use hardware video memory – which will result
in faster blit operations providing that you are not
frequently modifying the surfaces stored in video memory.

If you pass the HW_SURFACE option to SDL_ConvertSurface, it
should try to allocate the new surface in video memory.

Yes, theoretically you are limited to the number of surfaces
you can have in video memory by the amount of memory your
video card has.

PaulOn Thursday 14 October 2004 02:37 pm, Walter Crowley wrote:

When you create a SDL_Surface on the HW_SURFACE is it
actually on the video card or does it use system memory?
I believe this to be true, which really leads me to my
next question, If I convert more surfaces with
SDL_Convert does that also ‘put’ the surface on the
HW_SURFACE? If so then theoretically you can have as
many surfaces as memory that the card has.

Thanks,
Walt


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

When you create a SDL_Surface on the HW_SURFACE is it actually on the
video card or does it use system memory?

A hardware surface is in video card memory.

I believe this to be true,
which really leads me to my next question, If I convert more surfaces
with SDL_Convert does that also ‘put’ the surface on the HW_SURFACE?

SDL_Convert creates the type of surface you tell it to create. If you
tell it to create a hardware surface by setting the correct flag value
then it will create a hardware surface if it can.

If
so then theoretically you can have as many surfaces as memory that the
card has.

There are other APIs, such as SDL_CreateRGBSurface that also create
surfaces in hardware memory. It isn’t theoretical at all. You can create
hardware surfaces until you run out of video memory. Remember though,
your program is not the only program using video memory. It is very
unlikely that you can get 100% of video memory for you programs use.

	Bob PendletonOn Thu, 2004-10-14 at 16:37, Walter Crowley wrote:

Thanks,
Walt


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

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

Thanks for all of the input. Things are looking great now…

WaltOn Fri, 2004-10-15 at 09:36, Bob Pendleton wrote:

On Thu, 2004-10-14 at 16:37, Walter Crowley wrote:

When you create a SDL_Surface on the HW_SURFACE is it actually on the
video card or does it use system memory?

A hardware surface is in video card memory.

I believe this to be true,
which really leads me to my next question, If I convert more surfaces
with SDL_Convert does that also ‘put’ the surface on the HW_SURFACE?

SDL_Convert creates the type of surface you tell it to create. If you
tell it to create a hardware surface by setting the correct flag value
then it will create a hardware surface if it can.

If
so then theoretically you can have as many surfaces as memory that the
card has.

There are other APIs, such as SDL_CreateRGBSurface that also create
surfaces in hardware memory. It isn’t theoretical at all. You can create
hardware surfaces until you run out of video memory. Remember though,
your program is not the only program using video memory. It is very
unlikely that you can get 100% of video memory for you programs use.

  Bob Pendleton

Thanks,
Walt


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