Greetings,
There are a few options. One is to use the SDL_Gfx library. Look in
SDL_rotozoom.h. Another is to try using something like java.awt.Image
or 2DGraphics. I havn't tried this myself. However if you get the
pixels in the correct format it should probably work. You can access
the bytes of the SDLSurface very quickly with the
SDLSurface.getPixelData() method. Finally you could just use OpenGL.
Draw your sprites as Quads and then rotoation is no problem. If you
look at org.gljava.opengl.Sprite class this already takes care of doing
that. If you browse in there you should be able to see how to load an
image, turn it into a sprite, and get it displayed. OpenGL is probably
the best way as you will get all the awsome features of OpenGL for free.
Cheers,
-Ivan/
lem...@nw... wrote:
>Hello,
>
>I've started to port my C/SDL game (CarWars / http://www.nwolf.org/carwars)
>into JAVA with JAVA SDL binding.
>I'm looking for a method to rotate and resize an image... (Before, I was using
>a C library that was working pretty good ;))
>Any idea ?
>I've read that it's possible to use java.awt.Image or 2DGraphics with JAVA
>SDL, is that true ? Any example ?
>
>Thanks ;)
>
>
>
>
>
|