Re: [sdljava-users] Bug in SWIG_SetPixelData32 method / Suggestion
Status: Beta
Brought to you by:
ivan_ganza
From: Ivan Z. G. <iva...@ya...> - 2006-09-14 00:19:28
|
Greetings, Sorry for the delay! I finally got off my but and got everything working on my system so I can develop again. Everything is 64 bit for now though as I didn't get a 32 chroot working yet, but alas, that will have to wait for another time. I have applied the fix below to HEAD. Cheers, -Ivan/ Guillaume Legris wrote: >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 > > > >------------------------------------------------------------------------- >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >_______________________________________________ >sdljava-users mailing list >sdl...@li... >https://lists.sourceforge.net/lists/listinfo/sdljava-users > > |