Using the SDL_gfx library?

Started by
24 comments, last by CheddarCheese 13 years, 3 months ago
Yeah this has always been a pain of using SDL_GFX ( the fact you have to compile libs your self). Here is a site that has a built lib of SDL_GFX for windows
SDL_GFX binaries for windows

Then you can add them just as you did with SDL or SDL_TTF.

I know you can do it in dev cpp since i have done it my self.
Black CloakEpee Engine.
Advertisement
@ blackcloak, thanks a lot for your find! This is the exact file that I needed. Thanks!

Thanks everyone for all your help, it was very much appreciated.
Now I just need to figure out how to use rotozoom. Any sort of tutorial site out there? I will attempt to search for one.
SDL_Surface * NewRotatedSDLSurface = rotozoomSurfaceXY(_ImageToDraw->GetSDLSurface(), _ImageToDraw->GetRotation(),_ImageToDraw->GetScalingFactorX(),_ImageToDraw->GetScalingFactorY() ,_ImageToDraw->GetAntiAliased());

where
//_ImageToDraw->GetSDLSurface() is a SDL_Surface *
//_ImageToDraw->GetRotation() is a double
//_ImageToDraw->GetScalingFactorX() is a double
//ImageToDraw->GetScalingFactorY() is a double
//_ImageToDraw->GetAntiAliased()
//#define SMOOTHING_OFF 0
// #define SMOOTHING_ON 1

returns a new rotated / scaled SDL_Surface
then blit NewRotatedSDLSurface to your screen
Black CloakEpee Engine.
Well, I ran into a new problem. I'm not sure what's wrong, as it was completely fine the day before.

When I try to run my program a pop-up error appears and tells me "The program can't start because SDL_gfx.dll is missing from you computer."

Any ideas on this one?
Nevermind, I have found the problem.

@ blackcloak: Thanks for the information, however, I'm still having trouble deciphering how it works.

At the moment, I've tried the following:

I'm only using: #include "SDL/SDL_rotozoom.h" , as I only need rotozoom.
I have two global surfaces ready for use:
SDL_Surface *player = NULL;
SDL_Surface *rotated = NULL;

When the player surface is clicked on (I have all the code ready and working for the mouse event):

rotated = rotozoomSurface(player, 10, 0, 0);

Pretty much, this is a test to see if it worked. I wanted the rotated surface to copy the same picture of the player surface. It should be rotated by a value of 10. I don't need any zooming or things like that, so I left the other values at 0.

I know there's something wrong with this (as the program refuses to run with this line of code), and I don't know the problem, since I really don't know how it works.

Any help would be appreciated. (Should I make a new thread for this? It's no longer related to the original problem.)

This topic is closed to new replies.

Advertisement