[sdljava-users] Bug in SWIG_SetPixelData32 method / Suggestion
Status: Beta
Brought to you by:
ivan_ganza
From: Guillaume L. <le...@ho...> - 2006-08-23 20:46:10
|
Hi, First thanks for SDLJava. It's a great library ! There is a bug in the file SDLVideo.i (revision 1.32 from CVS HEAD) inside the method SWIG_SetPixelData32(SDL_Surface *surface, int data[]) : Uint32 * pixelData = (Uint32*)&data; has to be replaced by: Uint32 * pixelData = (Uint32*)data; (same thing for SWIG_GetPixelData32 method I guess...But not tested) I need this method because I have to draw an ARGB int array in a SDL surface. At First, I tried createRGBSurfaceFrom(int pixels[], ...). But JNI code seems not working (JVM crash) I also tried SDLSurface.getPixelData() which returns a direct byte buffer . It works fine on x86 Sun JVM but not (JVM crashed) with Jamvm + Classpath 0.92 on ARM which is my target. A little suggestion: I think that createRGBSurfaceFrom could be easily implemented in Java only with help of createRGBSurface() and getPixelData() (or SWIG_SetPixelData32) methods. Regards, Guillaume Legris |