Jump to content


C++/Rotate


3 replies to this topic

#1 JCubsGames

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 July 2009 - 12:42 AM

Hey, uh first post. First of all nice forum. I'm impressed. Uh, okay so I've been working with C++ for a while, I have a crappy generic easy program. Umm, this is gonna sound dumb but what do I write to make a sprite/main character rotate using DIK_LEFT and DIK_RIGHT. I don't really need horizontal flip. I already know how to make the character move using left and right, just not rotate. So basically I'm making a simulation. When you're in the air, I want the arrow keys to control you and if you hit collision on a certain ID you die. I guess. TYVM!

#2 SamuraiCrow

    Senior Member

  • Members
  • PipPipPipPip
  • 459 posts

Posted 25 July 2009 - 03:53 AM

You didn't say what API you're using. On SFML it is a built-in function using the texture-mapping functionality of OpenGL internally. On SDL 1.2.13 you need the SDL_gfx extension to do rotozoom, or else an OpenGL wrapper. SDL 1.3svn has the OpenGL functionality activated easily. Allegro will rotate in 2d only if your hardware supports it. If you're using DirectX, I'm sure it can do it but don't ask me how, I'm on a Mac and don't use DirectX.

#3 JCubsGames

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 July 2009 - 05:23 PM

SamuraiCrow said:

You didn't say what API you're using. On SFML it is a built-in function using the texture-mapping functionality of OpenGL internally. On SDL 1.2.13 you need the SDL_gfx extension to do rotozoom, or else an OpenGL wrapper. SDL 1.3svn has the OpenGL functionality activated easily. Allegro will rotate in 2d only if your hardware supports it. If you're using DirectX, I'm sure it can do it but don't ask me how, I'm on a Mac and don't use DirectX.

Not to sound like a complete moron, but I don't know what the hell your talking about. The only thing I can think of is that I use something called like C++ 2003 or something like that. But I would love to know what my API is and where I can locate it. Please don't tell me I'm a noob, 'cause I already know that.

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 25 July 2009 - 06:18 PM

C++ is a programming language, not an API. By "C++ 2003" I'll assume you mean Microsoft Visual C++ 2003, which is a set of C/C++ tools bundled with a development environment (also called an IDE). The API, in this context, is whatever library you're using to display your game graphics on screen. I'm not quite sure how you managed to get to the point of displaying sprites without knowing which API you're using. Are you working from a tutorial/example?

Anyway, you're at least using DirectX for input - the DIK_LEFT and DIK_RIGHT are DirectInput key names. But, assuming you are also using DirectX for graphics, that still leaves the question of whether you're using DirectDraw or Direct3D.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users