[SDL] A couple of questions...

Pontus Pihlgren Pontus.Pihlgren.5501 at student.uu.se
Thu Oct 2 04:31:00 PDT 2003


> Before I go running off re-inventing the wheel (my version would
undoubtedly
> look remarkably like a square), I wanted to see if any of you have already
> developed solutions for them:

Hey, square wheels would be kinda cool... bit bumpy though

> 1) I need to be able to read a source Rect from a bmp and rotate it 90
> degrees.
Check out SDL_LoadBMP()

> 2) Copy one SDL_Surface to another.
SDL_BlitSurface, as some other pointed out.

> 3) take a Rect and apply different levels of alpha, i.e., make one color
> fully transparent and then apply a % to the remainder of the image.
Use Gimp or Photoshop to set up transparency, not hard but some fiddeling may 
be necesarry. Then save the file as a .TGA(has always been a nice format in my 
opinion) with alpha chanel. Then download SDL_Image from libsdl.org, its a 
library that can load .TGA files to a surface with alpha information intact... 
then just blit it.

> I can go about these using brute force techniques but wanted to see if
> anyone out there had a more graceful solution.

Brute force is always kinda cool..

Cya and good luck.




More information about the SDL mailing list