[sdljava-users] UnsatisfiedLinkError Exception Problem
Status: Beta
Brought to you by:
ivan_ganza
From: Chris D. <Des...@nt...> - 2005-06-09 04:59:42
|
Hi, I'm having a bit of a problem with: IntBuffer pixelData = surface.getPixelData().asIntBuffer(); The code is throwing me the following exception. Exception in thread "main" java.lang.UnsatisfiedLinkError: SWIG_getPixelDirectByteBuffer at sdljava.x.swig.SWIG_SDLVideoJNI.SWIG_getPixelDirectByteBuffer(Native Method) at sdljava.x.swig.SWIG_SDLVideo.SWIG_getPixelDirectByteBuffer(SWIG_SDLVideo.java:266) at sdljava.video.SDLSurface.getPixelData(SDLSurface.java:950) at loach.screen.SurfaceTransformer.flipHorizontal(SurfaceTransformer.java:27) at loach.Loach.<init>(Loach.java:102) at loach.Loach.main(Loach.java:177) Picked up _JAVA_OPTIONS: -Dsun.java2d.d3d=true Please help, I'm not sure what is wrong. This code is used in some horizontal image flip transformation code I wrote. public static void flipHorizontal(SDLSurface surface) throws SDLException { surface.lockSurface(); int width = surface.getWidth(), height = surface.getHeight(), pixels = width * height ; IntBuffer pixelData = surface.getPixelData().asIntBuffer(); int[] data = pixelData.array(); int[][] pData = new int[pixels][4]; for (int i = 0; i < pixels; i++) { for (int j = 0; j < 4; j++) { pData[i][j] = data[i * j]; } } int[][][] rData = new int[height][width][4]; for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { rData[row][col] = pData[row * col]; } } int[] temp = new int[width]; for (int row = 0; row < height; row++) { for (int left = 0, right = rData[row].length - 1; left < right; left++, right--) { /* exchange the first and last */ temp = rData[row][left]; rData[row][left] = rData[row][right]; rData[row][right] = temp; } } /* deconstruct this shit and give me a fucking normal int array */ for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { for (int i = 0; i < 4; i++) { data[row * col * i] = rData[row][col][i]; } } } pixelData.clear(); pixelData.put(data); surface.unlockSurface(); } Thanks in advance, Chris -- |> Dessimat0r (Chris Dennett) /`\ | "We cannot turn back time, but we can _ _|_ _ move it forwards with our own hands." |;|_|;|_|;| \\. . / [www: http://codeknight.net ] \\: . / [e-mail: des...@nt... ] ||: U | /`\ [icq: 21477909 ] ||:. | [msn: des...@nt... ] \,/ ||: U.| ||: | \,/ ||: , | ___.--'~---''--~.__ __.------'''~`-'-, -~--' ~--.__..--~' `~----.__ |