Jump to content

  • Log In with Google      Sign In   
  • Create Account


Using the SDL_gfx library?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
25 replies to this topic

#21 blackcloak   Members   -  Reputation: 188

Like
0Likes
Like

Posted 30 December 2010 - 10:30 AM

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.

Sponsor:

#22 CheddarCheese   Members   -  Reputation: 116

Like
0Likes
Like

Posted 30 December 2010 - 01:49 PM

@ 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.

#23 CheddarCheese   Members   -  Reputation: 116

Like
0Likes
Like

Posted 30 December 2010 - 02:25 PM

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.

#24 blackcloak   Members   -  Reputation: 188

Like
0Likes
Like

Posted 31 December 2010 - 03:26 AM

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.

#25 CheddarCheese   Members   -  Reputation: 116

Like
0Likes
Like

Posted 31 December 2010 - 09:13 AM

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?

#26 CheddarCheese   Members   -  Reputation: 116

Like
0Likes
Like

Posted 01 January 2011 - 07:48 AM

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.)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS