Video Memory Revisited

A while back i asked how can i make my images using IMG_Load() go to Video
Memory, but the old response i received was about SDL_DisplayFormatAlpha()
which was great, but i still want to out some surfaces without Alpha into
video memory.

So does IMG_Load() automatically put the surface as video memory?

If no then how can i make them Video memory?

And can any of the SDL developers confirm that SDL has to move surfaces from
Video memory if they have an Alpha channel so they can be blitted

TX

“Patricia Curtis” <patricia.curtis at gmail.com> wrote:

So does IMG_Load() automatically put the surface as video memory?

no.

If no then how can i make them Video memory?

SDL_CreateRGBSurface(SDL_HWSURFACE, …);

And can any of the SDL developers confirm that SDL has to move
surfaces from Video memory if they have an Alpha channel so they can
be blitted

AFAIK, this entirely depends on the gfx-driver used. at least as long
as the target surface is the screen. surface -> surface blits are never
hardware accelerated. (this would be possible with the opengl backend
only with pbuffer / framebuffer objects support.)

best regards …
clemens

Hello !

So does IMG_Load() automatically put the surface as video memory?

No.

If no then how can i make them Video memory?

Create a HW Surface with SDL_CreateRGBSurface(SDL_HWSURFACE, …
and then blit the content from your Image Surface to this HWSurface.
Be carefull when you have enabled colorkey or alpha
blits on the image surface, then you have to disable them temporarily.
When you have done this SDL will copy each pixel with the exact information
to the destination surface, otherwise it would check for colorkeys, alpha
values …

CU