sdljava-users Mailing List for Java Binding for SDL (Page 15)
Status: Beta
Brought to you by:
ivan_ganza
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(43) |
Feb
(50) |
Mar
(44) |
Apr
(14) |
May
(18) |
Jun
(7) |
Jul
(26) |
Aug
(29) |
Sep
(28) |
Oct
(10) |
Nov
(5) |
Dec
(7) |
2006 |
Jan
(2) |
Feb
(9) |
Mar
(16) |
Apr
(1) |
May
(11) |
Jun
(8) |
Jul
(8) |
Aug
(5) |
Sep
(15) |
Oct
|
Nov
|
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(2) |
Jun
(4) |
Jul
(1) |
Aug
(14) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(3) |
Dec
(1) |
2009 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2016 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Ivan Z. G. <iva...@ya...> - 2005-02-21 01:41:31
|
I haven't had a chance to thinking about anything except doing the release. This is on my list of things to do. Thanks, -Ivan/ Chris Dennett wrote: > Did the mailing list send out a message with the same name with the > .diff attached? I'm not sure if everyone got it or not, since I've had > no confirmation, and there have been mailing list messages since then. > > The changes I made in it are quite useful, since it allows you to > store and use video modes, and it also cleans up some javadoc > comments, so please merge it with CVS if there are no problems. > Anyway, I'll re-attach it to this message. > >------------------------------------------------------------------------ > >Index: SDLVideo.java >=================================================================== >RCS file: /cvsroot/sdljava/sdljava/src/sdljava/video/SDLVideo.java,v >retrieving revision 1.20 >diff -u -r1.20 SDLVideo.java >--- SDLVideo.java 25 Jan 2005 02:17:23 -0000 1.20 >+++ SDLVideo.java 20 Feb 2005 00:06:04 -0000 >@@ -25,7 +25,6 @@ > > import sdljava.SDLMain; > import sdljava.SDLException; >-import java.util.List; > import java.util.HashMap; > > /** >@@ -45,61 +44,51 @@ > { > /** > * Transparency definitions: These define alpha as the opacity of a surface >- * > */ > public static final int SDL_ALPHA_OPAQUE = SWIG_SDLVideoConstants.SDL_ALPHA_OPAQUE; > > /** > * Transparency definitions: These define alpha as the opacity of a surface >- * > */ > public static final int SDL_ALPHA_TRANSPARENT = SWIG_SDLVideoConstants.SDL_ALPHA_TRANSPARENT; > > /** > * Surface is stored in system memory >- * > */ > public static final long SDL_SWSURFACE = SWIG_SDLVideoConstants.SDL_SWSURFACE; > > /** > * Surface is stored in video memory >- * > */ > public static final long SDL_HWSURFACE = SWIG_SDLVideoConstants.SDL_HWSURFACE; > > /** > * Surface uses asynchronous blits if possible >- * > */ > public static final long SDL_ASYNCBLIT = SWIG_SDLVideoConstants.SDL_ASYNCBLIT; > > /** > * Allows any pixel-format (Display surface) >- * > */ > public static final long SDL_ANYFORMAT = SWIG_SDLVideoConstants.SDL_ANYFORMAT; > > /** > * Surface has exclusive palette >- * > */ > public static final long SDL_HWPALETTE = SWIG_SDLVideoConstants.SDL_HWPALETTE; > > /** > * Surface is double buffered (Display surface) >- * > */ > public static final long SDL_DOUBLEBUF = SWIG_SDLVideoConstants.SDL_DOUBLEBUF; > > /** > * Surface is full screen (Display Surface) >- * > */ > public static final long SDL_FULLSCREEN = SWIG_SDLVideoConstants.SDL_FULLSCREEN; > > /** > * Surface has an OpenGL context (Display Surface) >- * > */ > public static final long SDL_OPENGL = SWIG_SDLVideoConstants.SDL_OPENGL; > >@@ -107,74 +96,52 @@ > * Surface supports OpenGL blitting (Display Surface). NOTE: This > * option is kept for compatibility only, and is not recommended > * for new code. >- * > */ > public static final long SDL_OPENGLBLIT = SWIG_SDLVideoConstants.SDL_OPENGLBLIT; > > /** > * Surface is resizable (Display Surface) >- * > */ > public static final long SDL_RESIZABLE = SWIG_SDLVideoConstants.SDL_RESIZABLE; > > /** > * No window caption or edge frame >- * > */ > public static final long SDL_NOFRAME = SWIG_SDLVideoConstants.SDL_NOFRAME; > > /** > * Surface blit uses hardware acceleration >- * > */ > public static final long SDL_HWACCEL = SWIG_SDLVideoConstants.SDL_HWACCEL; > > /** > * Surface use colorkey blitting >- * > */ > public static final long SDL_SRCCOLORKEY = SWIG_SDLVideoConstants.SDL_SRCCOLORKEY; > > /** > * Colorkey blitting is accelerated with RLE >- * > */ > public static final long SDL_RLEACCEL = SWIG_SDLVideoConstants.SDL_RLEACCEL; > > /** > * Surface blit uses alpha blending >- * > */ > public static final long SDL_SRCALPHA = SWIG_SDLVideoConstants.SDL_SRCALPHA; > > /** > * Surface uses preallocated memory >- * > */ > public static final long SDL_PREALLOC = SWIG_SDLVideoConstants.SDL_PREALLOC; > >- >- >- >- >- >- >- >- >- >- >- >- >- >- >- >- > /** Is the cursor visible? > * @see #showCursor(int) */ > public static final int SDL_QUERY = -1; >+ > /** Hide the cursor. > * @see #showCursor(int) */ > public static final int SDL_DISABLE = 0; >+ > /** Show the cursor > * @see #showCursor(int) */ > public static final int SDL_ENABLE = 1; >@@ -262,6 +229,25 @@ > public static int videoModeOK(int width, int height, int bpp, int flags) throws SDLException { > return SWIG_SDLVideo.SDL_VideoModeOK(width, height, bpp, flags); > } >+ >+ /** >+ * Same as the method in this class with the same name, but this gets the >+ * width, height, BPP, and flag values from the SDLScreenMode instance >+ * instead. >+ * >+ * @author <a href="Des...@nt...">Chris Dennett</a> >+ * @param videoMode The video mode to test >+ * @return Same as the method with the same name. >+ * @exception SDLException If an error occurs >+ */ >+ public static int videoModeOK(SDLVideoMode videoMode) throws SDLException { >+ return videoModeOK( >+ videoMode.getWidth(), >+ videoMode.getHeight(), >+ videoMode.getBpp(), >+ videoMode.getFlags() >+ ); >+ } > > /** > * Set up a video mode with the specified width, height and bits-per-pixel. >@@ -337,6 +323,25 @@ > > return new SDLSurface(surface); > } >+ >+ /** >+ * Same as the method in this class with the same name, but this gets the >+ * width, height, BPP, and flag values from the SDLScreenMode instance >+ * instead. >+ * >+ * @author <a href="Des...@nt...">Chris Dennett</a> >+ * @param videoMode The video mode to set >+ * @return The framebuffer surface >+ * @throws SDLException If an error occurs >+ */ >+ public static SDLSurface setVideoMode(SDLVideoMode videoMode) throws SDLException { >+ return setVideoMode( >+ videoMode.getWidth(), >+ videoMode.getHeight(), >+ videoMode.getBpp(), >+ videoMode.getFlags() >+ ); >+ } > > /** > * Set the gamma correction for each of the color channels. >@@ -362,9 +367,9 @@ > * > * You must pass in valid pointers to arrays of 256 16-bit quantities. > * Any of the pointers may be NULL to ignore that channel. >- * If the call succeeds, it will return 0. If the display driver or >- * hardware does not support gamma translation, or otherwise fails, >- * this function will return -1. >+ * >+ * @return The current values of the gamma translation tables. >+ * > * @exception SDLException If an error occurs > */ > public static GammaTable getGammaRamp() throws SDLException { >@@ -388,13 +393,11 @@ > * gamma value at that index, scaled to the output color precision. > * > * You may pass NULL for any of the channels to leave it unchanged. >- * If the call succeeds, it will return 0. If the display driver or >- * hardware does not support gamma translation, or otherwise fails, >- * this function will return -1. >+ * > * @param red an <code>int[]</code> value > * @param green an <code>int[]</code> value > * @param blue an <code>int[]</code> value >- * @return a <code>boolean</code> value >+ * > * @exception SDLException If an error occurs > */ > public static void setGammaRamp(int[] red, int[] green, int[] blue) throws SDLException { >@@ -545,7 +548,7 @@ > * the SDL_HWSURFACE flag set, and will be created in system memory instead. > * > * @param flags Flags for this surface >- * @param height Desired width >+ * @param width Desired width > * @param height Desired height > * @param depth Desidred depth (bits per pixel) > * @param rMask Red Mask >@@ -600,8 +603,7 @@ > > /** > * Load a surface from a BMP file located at path. >- * >- * @parm The filesystem path of the file with the image data in BMP format >+ * @param path The filesystem path of the file with the image data in BMP format > * @return the new surface > * @exception SDLException If an error occurs > */ >Index: SDLVideoMode.java >=================================================================== >RCS file: /cvsroot/sdljava/sdljava/src/sdljava/video/SDLVideoMode.java,v >retrieving revision 1.3 >diff -u -r1.3 SDLVideoMode.java >--- SDLVideoMode.java 24 Dec 2004 17:32:17 -0000 1.3 >+++ SDLVideoMode.java 20 Feb 2005 00:06:04 -0000 >@@ -24,7 +24,7 @@ > * Class to represent a possible SDL Video Mode (not part of SDL) > * > * >- * @author Ivan Z. Ganza >+ * @author Ivan Z. Ganza, <a href="mailto:Des...@nt...">Dessimat0r</a> > * @version $Id: SDLVideoMode.java,v 1.3 2004/12/24 17:32:17 ivan_ganza Exp $ > */ > public class SDLVideoMode { >@@ -32,40 +32,60 @@ > int height; > int bpp; > int flags; >+ >+ /** >+ * Creates a new SDLVideoMode object. >+ * @param width The width of the screen. >+ * @param height The height of the screen >+ * @param bpp The bits per pixel. >+ * @param flags The flags of the video mode. >+ */ >+ public SDLVideoMode(int width, int height, int bpp, int flags) { >+ this.width = width; >+ this.height = height; >+ this.bpp = bpp; >+ this.flags = flags; >+ } >+ >+ /** >+ * Creates a new SDLVideoMode object with no flags. >+ * @param width The width of the screen. >+ * @param height The height of the screen >+ * @param bpp The bits per pixel. >+ */ >+ public SDLVideoMode(int width, int height, int bpp) { >+ this(width, height, bpp, 0); >+ } > > /** >- * Gets the value of width >- * >- * @return the value of width >+ * The width of the screen >+ * @return The screen width > */ > public int getWidth() { >- return this.width; >+ return this.width; > } > > /** >- * Gets the value of height >- * >- * @return the value of height >+ * The height of the screen >+ * @return The screen height > */ > public int getHeight() { >- return this.height; >+ return this.height; > } > > /** >- * Gets the value of bpp >- * >- * @return the value of bpp >+ * The bits per pixel >+ * @return The bits per pixel > */ > public int getBpp() { >- return this.bpp; >+ return this.bpp; > } > > /** >- * Gets the value of flags >- * >- * @return the value of flags >+ * The flags of the video mode >+ * @return The flags of the video mode > */ > public int getFlags() { >- return this.flags; >+ return this.flags; > } > } // class VideoMode >\ No newline at end of file > > |
From: Chris D. <Des...@nt...> - 2005-02-20 23:40:53
|
Did the mailing list send out a message with the same name with the .diff attached? I'm not sure if everyone got it or not, since I've had no confirmation, and there have been mailing list messages since then. The changes I made in it are quite useful, since it allows you to store and use video modes, and it also cleans up some javadoc comments, so please merge it with CVS if there are no problems. Anyway, I'll re-attach it to this message. -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Ivan Z. G. <iva...@ya...> - 2005-02-20 22:32:39
|
Greetings, I'm happy to announce the next release of sdljava - sdljava-0.9.1 sdljava is a java binding to the SDL API. This release includes many new features. The major changes were the removal of the dependency on JDK 1.5 and the addition of the OpenGL binding via GLEW (http://glew.sourceforge.net) and a binding to FTGL (http://homepages.paradise.net.nz/henryj/code/#FTGL). Also a new developer has joined the team: Bart LEBEOUF bartleboeuf at yahoo.fr. Bart has helped create the build environments on the windows side as well many additions in various places in the codebase. I hope you find this useful. Please send any questions to the mailing list. -Ivan/ ------------------------------ Changes: * added jniclasscode pragma's to swig interface (.i) files which cal= l System.loadLibrary for the appropriate lib. Now there is no need t= o call System.loadLibrary explictly from code which utilizes sdljava =20 * added new methods to SDLMixer (SDLMixer version requirement is stil= l 1.2.5) public static MixChunk loadWAV(Buffer buf) throws SDLException public static MixChunk loadWAV(byte[] data) throws SDLException public static MixChunk loadWAV(URL url) throws SDLException,=20 IOException, MalformedURLException public static MixChunk loadWAV(InputStream in) throws=20 SDLException, IOException =20 public static MixMusic loadMUS(Buffer buf) throws SDLException { public static MixMusic loadMUS(byte[] data) throws SDLException public static MixMusic loadMUS(URL url) throws SDLException,=20 IOException, MalformedURLException public static MixMusic loadMUS(InputStream in) throws=20 SDLException, IOException =20 * added new methods to SDLImage public static SDLSurface load(Buffer buf) throws SDLException public static SDLSurface load(byte[] data) throws SDLException public static SDLSurface load(URL url) throws SDLException,=20 IOException, MalformedURLException public static SDLSurface load(InputStream in ) throws=20 SDLException, IOException =20 * JDK 1.5 enumerations removed. Any existing code which used these enumerations needs to be slightly modified. Please see tests for examples of how to use. =20 * CDStatus.java is no longer a JDK 1.5 enumeration * SDLGrabMode.java is no longer a JDK 1.5 enumeration * SDLAppState.java is no longer a JDK 1.5 enumeration * SDLEventAction.java is no longer a JDK 1.5 enumeration * SDLEventState.java is no longer a JDK 1.5 enumeration * SDLKey.java is no longer a JDK 1.5 enumeration * SDLEvent.java method eventState now takes an int for the event type method getKeyName now takes an int method getType now returns an int =20 * ALL JDK 1.5 dependencies removed. JDK 1.5 is no longer required!! =20 * OpenGL 1.1 Support added!!! * new methods on SDLSurface getGL() and glSwapBuffers() to access =20 * BufferUtil.java changed readInputStream() so that when it created the ByteBuffer to ordering is set to the native byte order. =20 * SDLSurface added mustLock() method =20 * BufferUtil.java: integrated patch from Robert Schuster <theBohemian at gmx.net> which fixed the problem of loading byte streams from URLs over the network. Thanks Robert! =20 * SDLSurface added ByteBuffer getPixelData() method which returns direct byte buffer for pixel data access! Removed get/setPixelDataXXXX() methods =20 * FTGL binding added=20 (http://homepages.paradise.net.nz/henryj/code/#FTGL). =20 Font support is now available for OpenGL binding. Check out=20 FTGLTest example code. =20 * Moved gljava and ftgl build to src/org/gljava/opengl/native directo= ry =20 * Added ability to disable automatic loading of shared library. Specify -Dsdljava.bootclasspath=3Dtrue (or any value) to the java v= m and no shared libraries will be loaded. =20 Thanks to St=E9phane Meslin-Weber <steph at tangency.co.uk> for the suggestions. =20 * added org.gljava.opengl.model package to faciliate dealing with 3D model data. Also added gljava_export.py blender export script whic= h exports xml format file which can be imported by XMLModelLoader in same pacakge. (there is much to be done here stil...) =20 * added DebugGL for debug pipeline support. Please see source file for documentatin. =20 * Changed methods in SDLGfx which took short[] to take ShortBuffer instances instead. Note: these methods are currently not working. =20 * added version API; SDLMain.getSDLVersion(),=20 SDLMixer.getMixVersion(), SDLTTF.getTTFVersion() ------------------------------ Required/Recommended Libraries: (higher version should be fine) - Java 1.4 - SDL 1.2.7 =20 - GLEW 1.3.1 (http://glew.sourceforge.net) for OpenGL Support (option= al) - FTGL 2.1.3 (http://homepages.paradise.net.nz/henryj/code/#FTGL)=20 for FreeType font Support w/OpenGL (optional) =20 - SDL_image 1.2.3 (optional) - SDL_mixer 1.2.5 (optional) - SDL_ttf 2.0.6 (optional) - SDL_gfx 2.0.13 (optional) =20 - Ant 1.6.2 (optional, only if you need want to compile java sources) - SWIG 1.3.22 (optional, only if you want to re-generate native layer) - Ruby 1.8.2 (optional, only if you want to re-generate SOME of native layer) |
From: Chris D. <Des...@nt...> - 2005-02-20 00:13:14
|
I've modified the SDLVideoMode class to make it usable, and I've modified the SDLVideo class to also accept SDLVideoMode instances when setting modes. Please tell me if there is anything wrong with my modifications. -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Chris D. <Des...@nt...> - 2005-02-19 18:00:06
|
Hi, I'm looking for a working version of sdl_gfx.dll that works with SDLJava. When I'm importing it at the moment, I'm getting the following error message: java.lang.UnsatisfiedLinkError: D:\Java Code\sdljava\lib\sdljava_gfx.dll: The specified procedure could not be found When I compile the DLL from source, I also get something similar, so I have no idea what is going on. Thanks in advance, Chris -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Bart L. <bar...@ya...> - 2005-02-19 11:27:29
|
Hi, Give a look on sdljava.util.BufferUtil class on CVS, which have methods to create direct native type buffers. CUS, /Bart. --- Robert Schuster <the...@gm...> a écrit : > Hi. > I have not seen how you create and fill the > ShortBuffer but it could be > a problem with endianness/byte-order (or byte sex :) > ). > > ByteBuffer.allocateDirect(2*NUM_OF_SHORTS).byteOrder(ByteOrder.nativeOrder()).asShortBuffer() > > should do the trick > > cu > Robert > > Ivan Z. Ganza wrote: > > > I've checked in code which effectively changes all > short[] arguments > > to ShortBuffers(s) instead. > > > > There is a problem however and I'm not sure what > it is. Running > > test-aaploygonRGBA.bsh results in the following > out -- although I am > > passing sane values when the ShortBuffer is read > on the C side the > > values are all messed up. This is strange because > I'm using the same > > idea with the OpenGL layer and all seems to work > fine. I'm not access > > the buffers myself on the OpenGL though, OpenGL > is, yet it works fine > > in that case. If any has a clue please let me > know....The code looks > > like this: void* vx and void* vy are pointers > obtained via > > getDirectByteBufferAddress()... > > > > int SWIG_aapolygonRGBA(SDL_Surface *dst, void* vx, > void* vy, int n, > > Uint8 r, Uint8 g, Uint8 b, Uint8 a) { > > > > int i; > > > > for (i = 0; i < n; i++) { > > Sint16* svx = (Sint16*)vx; > > Sint16* svy = (Sint16*)vy; > > printf("n=%i, vx=%i, vy=%i\n", i, svx[i], > svy[i]); > > } > > return aapolygonRGBA(dst, (Sint16*)vx, > (Sint16*)vy, n, r, g, b, a); > > } > > > > > > n=0, vx=28928, vy=29288 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=28928 > > n=0, vx=31440, vy=31800 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=31440 > > n=0, vx=-31552, vy=-31192 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-31552 > > n=0, vx=-29040, vy=-28680 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-29040 > > n=0, vx=-26528, vy=-26168 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-26528 > > n=0, vx=-24000, vy=-23640 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-24000 > > n=0, vx=-21488, vy=-21128 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-21488 > > n=0, vx=-18976, vy=-18616 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-18976 > > n=0, vx=-16464, vy=-16104 > > n=1, vx=17819, vy=17819 > > n=2, vx=-28704, vy=-16464 > > > > > > gol...@un... wrote: > > > >> Thanks for responding so quick :) > >> > >> If i find some free time today i'll try to > compile from cvs (which i > >> tried before but never succeded) > >> > >> Goliat > >> > >> PS: if this is a html mail ... sry ;) (trying to > get kmail working) > >> > >> > >> > ------------------------------------------------------- > >> SF email is sponsored by - The IT Product Guide > >> Read honest & candid reviews on hundreds of IT > Products from real users. > >> Discover which products truly live up to the > hype. Start reading now. > >> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > >> _______________________________________________ > >> sdljava-users mailing list > >> sdl...@li... > >> > https://lists.sourceforge.net/lists/listinfo/sdljava-users > >> > >> > > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT > Products from real users. > > Discover which products truly live up to the hype. > Start reading now. > > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > sdljava-users mailing list > > sdl...@li... > > > https://lists.sourceforge.net/lists/listinfo/sdljava-users > > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sdljava-users mailing list > sdl...@li... > https://lists.sourceforge.net/lists/listinfo/sdljava-users > Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ |
From: Robert S. <the...@gm...> - 2005-02-19 07:07:01
|
Hi. I have not seen how you create and fill the ShortBuffer but it could be a problem with endianness/byte-order (or byte sex :) ). ByteBuffer.allocateDirect(2*NUM_OF_SHORTS).byteOrder(ByteOrder.nativeOrder()).asShortBuffer() should do the trick cu Robert Ivan Z. Ganza wrote: > I've checked in code which effectively changes all short[] arguments > to ShortBuffers(s) instead. > > There is a problem however and I'm not sure what it is. Running > test-aaploygonRGBA.bsh results in the following out -- although I am > passing sane values when the ShortBuffer is read on the C side the > values are all messed up. This is strange because I'm using the same > idea with the OpenGL layer and all seems to work fine. I'm not access > the buffers myself on the OpenGL though, OpenGL is, yet it works fine > in that case. If any has a clue please let me know....The code looks > like this: void* vx and void* vy are pointers obtained via > getDirectByteBufferAddress()... > > int SWIG_aapolygonRGBA(SDL_Surface *dst, void* vx, void* vy, int n, > Uint8 r, Uint8 g, Uint8 b, Uint8 a) { > > int i; > > for (i = 0; i < n; i++) { > Sint16* svx = (Sint16*)vx; > Sint16* svy = (Sint16*)vy; > printf("n=%i, vx=%i, vy=%i\n", i, svx[i], svy[i]); > } > return aapolygonRGBA(dst, (Sint16*)vx, (Sint16*)vy, n, r, g, b, a); > } > > > n=0, vx=28928, vy=29288 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=28928 > n=0, vx=31440, vy=31800 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=31440 > n=0, vx=-31552, vy=-31192 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-31552 > n=0, vx=-29040, vy=-28680 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-29040 > n=0, vx=-26528, vy=-26168 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-26528 > n=0, vx=-24000, vy=-23640 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-24000 > n=0, vx=-21488, vy=-21128 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-21488 > n=0, vx=-18976, vy=-18616 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-18976 > n=0, vx=-16464, vy=-16104 > n=1, vx=17819, vy=17819 > n=2, vx=-28704, vy=-16464 > > > gol...@un... wrote: > >> Thanks for responding so quick :) >> >> If i find some free time today i'll try to compile from cvs (which i >> tried before but never succeded) >> >> Goliat >> >> PS: if this is a html mail ... sry ;) (trying to get kmail working) >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> sdljava-users mailing list >> sdl...@li... >> https://lists.sourceforge.net/lists/listinfo/sdljava-users >> >> > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sdljava-users mailing list > sdl...@li... > https://lists.sourceforge.net/lists/listinfo/sdljava-users > > |
From: Ivan Z. G. <iva...@ya...> - 2005-02-19 02:07:12
|
I've checked in code which effectively changes all short[] arguments to ShortBuffers(s) instead. There is a problem however and I'm not sure what it is. Running test-aaploygonRGBA.bsh results in the following out -- although I am passing sane values when the ShortBuffer is read on the C side the values are all messed up. This is strange because I'm using the same idea with the OpenGL layer and all seems to work fine. I'm not access the buffers myself on the OpenGL though, OpenGL is, yet it works fine in that case. If any has a clue please let me know....The code looks like this: void* vx and void* vy are pointers obtained via getDirectByteBufferAddress()... int SWIG_aapolygonRGBA(SDL_Surface *dst, void* vx, void* vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { int i; for (i = 0; i < n; i++) { Sint16* svx = (Sint16*)vx; Sint16* svy = (Sint16*)vy; printf("n=%i, vx=%i, vy=%i\n", i, svx[i], svy[i]); } return aapolygonRGBA(dst, (Sint16*)vx, (Sint16*)vy, n, r, g, b, a); } n=0, vx=28928, vy=29288 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=28928 n=0, vx=31440, vy=31800 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=31440 n=0, vx=-31552, vy=-31192 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-31552 n=0, vx=-29040, vy=-28680 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-29040 n=0, vx=-26528, vy=-26168 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-26528 n=0, vx=-24000, vy=-23640 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-24000 n=0, vx=-21488, vy=-21128 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-21488 n=0, vx=-18976, vy=-18616 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-18976 n=0, vx=-16464, vy=-16104 n=1, vx=17819, vy=17819 n=2, vx=-28704, vy=-16464 gol...@un... wrote: >Thanks for responding so quick :) > >If i find some free time today i'll try to compile from cvs (which i tried >before but never succeded) > >Goliat > >PS: if this is a html mail ... sry ;) (trying to get kmail working) > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >sdljava-users mailing list >sdl...@li... >https://lists.sourceforge.net/lists/listinfo/sdljava-users > > |
From: <gol...@un...> - 2005-02-18 15:16:00
|
Thanks for responding so quick :) If i find some free time today i'll try to compile from cvs (which i tried before but never succeded) Goliat PS: if this is a html mail ... sry ;) (trying to get kmail working) |
From: Ivan Z. G. <iva...@ya...> - 2005-02-18 02:55:17
|
Greetings Goliat. Welcome to the list. Thanks for finding this. I've been able to reproduce it and something is defiantly wrong here. I'm not quite sure why it happends. I've just realized that all this SDLGfx code needs to be changed to transfer the co-ordinates via NIO Direct Buffers -- so I've tried a quick change to this method with an NIO buffer, and this seems to be working properly. I'm going to change all the methods to use this method instead of java arrays. This will also allow it to be MUCH faster as no copy has to occur between java and C -- also the possibility exists to reuse already created ByteBuffers.... For example the method now looks like this: public static int polygonRGBA(SDLSurface dst, ShortBuffer vx, ShortBuffer vy, short r, short g, short b, short a) I would like to get this in with the release. I'm going to check in the above change incase you want to try that one method and your on CVS. If you have a chance let me know if it works for you. -Ivan/ Goliat Skipson wrote: > First hello to the list :) > > i've played around with sdljava for some time and now i have a little > problem ... > the method aaPolygonRGBA in SDLGfx seems to be broken somehow > > by using this (sample) call to the method: > > short[] sx = { 10, 10, 105, 10 }; > short[] sy = { 5, 7, 100, 5 }; > SDLGfx.aapolygonRGBA( surface , sx, sy, (short)255, (short)255, > (short)255, (short)255 ); > > i get my gamescreen but no drawn polygon and after a while some lines > which cover the whole surface appear, additionally they seem to appear > spontaniously after some frames more or less everytime i restart the > whole thing > > unfortunatly i just tried to do a screenshot of the lines ... but they > didn't appear at all ... neither the polygon was drawn > > i'm using sdljava-0.9.0 and the sun jdk 5.0 running on a gentoo system > with a current 2.6.10 kernel (with those thousand gentoo patches) > > greetz Goliat > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sdljava-users mailing list > sdl...@li... > https://lists.sourceforge.net/lists/listinfo/sdljava-users |
From: Goliat S. <gol...@un...> - 2005-02-17 22:51:17
|
First hello to the list :) i've played around with sdljava for some time and now i have a little problem ... the method aaPolygonRGBA in SDLGfx seems to be broken somehow by using this (sample) call to the method: short[] sx = { 10, 10, 105, 10 }; short[] sy = { 5, 7, 100, 5 }; SDLGfx.aapolygonRGBA( surface , sx, sy, (short)255, (short)255, (short)255, (short)255 ); i get my gamescreen but no drawn polygon and after a while some lines which cover the whole surface appear, additionally they seem to appear spontaniously after some frames more or less everytime i restart the whole thing unfortunatly i just tried to do a screenshot of the lines ... but they didn't appear at all ... neither the polygon was drawn i'm using sdljava-0.9.0 and the sun jdk 5.0 running on a gentoo system with a current 2.6.10 kernel (with those thousand gentoo patches) greetz Goliat |
From: Ivan Z. G. <iva...@ya...> - 2005-02-15 03:23:00
|
Each method in SDLSurface maps 1:1 to a function found in SDL_video.h -- the names are derived directly from the sdl function names to make it easier to figure out how to use sdljava. From SDL_video.h: /* * Makes sure the given list of rectangles is updated on the given screen. * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire * screen. * These functions should not be called while 'screen' is locked. */ extern DECLSPEC void SDLCALL SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects); extern DECLSPEC void SDLCALL SDL_UpdateRect (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); In sdljava we have: public void updateRect(int x,int y, long w, long h) public void updateRect(SDLRect r) throws SDLException public void updateRect() throws SDLException The first two update what you give it. The last updates the entire screen. We are missing: public void updateRects(SDLRect[] rects) because for some reason I remarked it out. I will enable it again. Its not implemented in an efficient way however in that each item in rects results in a call to the C layer and SDL_updateRect (instead of one and only one call to SDL_UpdateRects). Image data is NEVER ever transferred between the C layer and the java layer (except in the case of SDLVideo.createRGBSurfaceFrom() that I know off). If you wanted to access the image data this would be done via NIO buffers -- so no data would actually be copied from C to Java. -Ivan/ Chris Dennett wrote: > I also have a concern about updateRect() in the SDLSurface class -- it > is a method that may be able to handle many data types in the future, > so it should be renamed to 'update()'. At the moment, it can also take > no parameters to update the entire thing, so it is actually currently > ambiguous in this situation. > > Also, what is update() actually doing? Is it transferring the image > from system memory to the graphics card memory, or what? The method > name update() really dosen't really say a lot. Perhaps this needs to > be looked into further to deambiguise things for the user. > > Regards, > Chris > |
From: Ivan Z. G. <iva...@ya...> - 2005-02-15 03:15:09
|
I checked in code which returns an SDLVersion instance if you call version() on SDLMain. Let me know if this is along the lines of what you had in mind. I will add for other modules soon... -Ivan/ Ivan Z. Ganza wrote: > Yes I remember, sorry it had slipped my mind, this feature will get > added. > > -Ivan/ > > Robert Schuster wrote: > >> Hi >> >>> >>> If anyone wants to get a feature in for 0_9_1 please drop me a note. >>> >> Some time ago I asked for this: >> >> Btw: Could you add a version API? It would be nice to retrieve SDL's >> version and the version of the binding itself programmatically. >> >> IMHO this would be a nice feature. My game prints out a log when >> starting where besides other things the version numbers of underlying >> APIs appear. If something goes wrong on a user's machine he/she can >> send me the log and I can quickly see which versions of APIs where in >> use. >> >> cu >> Robert >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> sdljava-users mailing list >> sdl...@li... >> https://lists.sourceforge.net/lists/listinfo/sdljava-users > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sdljava-users mailing list > sdl...@li... > https://lists.sourceforge.net/lists/listinfo/sdljava-users |
From: Ivan Z. G. <iva...@ya...> - 2005-02-15 02:21:06
|
Yes I remember, sorry it had slipped my mind, this feature will get added. -Ivan/ Robert Schuster wrote: > Hi > >> >> If anyone wants to get a feature in for 0_9_1 please drop me a note. >> > Some time ago I asked for this: > > Btw: Could you add a version API? It would be nice to retrieve SDL's > version and the version of the binding itself programmatically. > > IMHO this would be a nice feature. My game prints out a log when > starting where besides other things the version numbers of underlying > APIs appear. If something goes wrong on a user's machine he/she can > send me the log and I can quickly see which versions of APIs where in > use. > > cu > Robert > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sdljava-users mailing list > sdl...@li... > https://lists.sourceforge.net/lists/listinfo/sdljava-users |
From: Robert S. <the...@gm...> - 2005-02-14 12:14:34
|
Hi > > If anyone wants to get a feature in for 0_9_1 please drop me a note. > Some time ago I asked for this: Btw: Could you add a version API? It would be nice to retrieve SDL's version and the version of the binding itself programmatically. IMHO this would be a nice feature. My game prints out a log when starting where besides other things the version numbers of underlying APIs appear. If something goes wrong on a user's machine he/she can send me the log and I can quickly see which versions of APIs where in use. cu Robert |
From: Chris D. <Des...@nt...> - 2005-02-14 04:40:47
|
I also have a concern about updateRect() in the SDLSurface class -- it is a method that may be able to handle many data types in the future, so it should be renamed to 'update()'. At the moment, it can also take no parameters to update the entire thing, so it is actually currently ambiguous in this situation. Also, what is update() actually doing? Is it transferring the image from system memory to the graphics card memory, or what? The method name update() really dosen't really say a lot. Perhaps this needs to be looked into further to deambiguise things for the user. Regards, Chris -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Ivan Z. G. <iva...@ya...> - 2005-02-14 04:05:07
|
You bring up a good question. The reason it has been implemented this way is because SDLSurface should not have a dependency on the SDL_Image library. If we put those methods into SDLSurface you would also have to link in the SDL_Image into the core. I would like to keep them separated as such so that you can pick and choose which library to use -- but not depend on any others. In reality all the SDLImage API is already provided by java libraries in java core and jai I believe. So the benefit of SDLImage for us is questionable. The method SDLVideo.createRGBSurfaceFrom(...) could be used to load images loaded via standard java libraries (note; for next release this method will be re-implemented with NIO buffers). Perhaps we should provide some helper methods within SDLVideo to create surfaces from images which then invoke the standard java api's to do so. It cannot be an actual java filehandle because the string is transferred directly to: SDL_Surface * SDLCALL IMG_Load(const char *file); And SDL has no idea what a java file handle would mean. Thanks for the compliment. I want this to be a an API that can seriously be used to develop most types of games in java. Please give me any more of your comments. PS: we're ramping up for the next release. Should be within two weeks or so. Please see the CHANGES_0_9_1 for a list of whats coming. There is more to add to the file but its mostly up to date. If anyone wants to get a feature in for 0_9_1 please drop me a note. Thanks -Ivan/ Chris Dennett wrote: > I've got a question regarding SDLImage. Is it me, or is this class > redundant? To me, it just seems to be a factory class for SDLSurface, > from which image surfaces can be created from filename handles (as > strings), and it may be better to transfer the load methods back to > SDLSurface as constructors, while keeping stub methods in SDLimage for > backwards compatiblity. Also, perhaps filename should be an actual > file handle type, instead of a String, from the underlying Java > architecture (if it exists)? ;) > > On the whole, however, this seems really well implemented, but I think > you have to carry on reaching into the Java architecture for well > defined types. > > Regards, > Chris > |
From: Chris D. <Des...@nt...> - 2005-02-14 03:43:32
|
I've got a question regarding SDLImage. Is it me, or is this class redundant? To me, it just seems to be a factory class for SDLSurface, from which image surfaces can be created from filename handles (as strings), and it may be better to transfer the load methods back to SDLSurface as constructors, while keeping stub methods in SDLimage for backwards compatiblity. Also, perhaps filename should be an actual file handle type, instead of a String, from the underlying Java architecture (if it exists)? ;) On the whole, however, this seems really well implemented, but I think you have to carry on reaching into the Java architecture for well defined types. Regards, Chris -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Ivan Z. G. <iva...@ya...> - 2005-02-14 01:52:41
|
Sounds like you got it working now. Thanks everyone for your help on the list. Regarding the portability -- it is just assumed that the SDL libraries can be resolved and are installed properly. Either present in c:\windows\system32 or in some other way configured so that the VM can locate the required libraries. I will update the INSTALL doc to be more clear on this aspect. If you were to actually ship a game created with sdljava then you would want to package up the SDL dll files you need (SDL, SDL_mixer, etc...) and have the installer for your game install these in the appropriate places. The users of your game should not have to deal with anything special. It should follow a standard install process like that for any game you buy off the shelf. Again I will update the documentation to be more clear and hopefully avoid this problem in the future. Please continue to send questions/comments/etc... -Ivan/ Chris Dennett wrote: > Great! The script now works! All I had to do is download SDL from > ww.libsdl.org and plonk SDL.dll into my c:\windows\system32 directory. > System.loadLibrary("sdljava"); is still required, however. I'll have a > go at using it, and use the mailing list again if any other problems > arise. > > By the way, I have doubts about the portability of this code. How many > users are going to mess around with all this if they want to play an > SDL Java game on their system? It seems that Java is a bit wrapped in > obfuscation when it comes to using C libraries. > > Regards, > Chris > > > Robert Schuster wrote: > >> Hi Chris, >> >> at first I wonder whether this can work: >> >> -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 >> -Djava.library.path="d:/Java Code/sdljava/lib" >> >> You should put both absolute filenames in one argument. On Windows >> you separate usually with a ; >> It should look like: >> >> -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86;"d:/Java >> Code/sdljava/lib" >> >> --- >> >> Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java >> Code\sdljava\ >> lib\sdljava.dll: Can't find dependent libraries >> >> This one looks like sdljava's JNI library (sdljava.dll) cannot find >> SDL itself. If have no idea how you solve that on Windows elegantly. >> On GNU/Linux and other Unices we install libraries usually system >> wide which is less usually on Windows. >> As a workaround you can download SDL's DLLs from libsdl.org and put >> them in the same directory as sdljava.dll. >> >> >> cu >> Robert > > > |
From: LEBOEUF B. <bar...@ya...> - 2005-02-14 00:49:55
|
Hi Chris, For executing SDLJava Applications inside Eclipse you'll need = sdljava.dll and SDL.dll inside your java.library.path (d:/Java Code/sdljava/lib). Next go in menu "Run" -> "Run...", select your application and clic on "Arguments" tab. Put in "VM Arguments :" part the following text "-Djava.library.path=3Dd:\Java Code\sdljava\lib" and at last just below, = set your root "working directory" to the lib path. See the screen captures attach to this mail to have an idea. CUS, /Bart -----Message d'origine----- De=A0: sdl...@li... [mailto:sdl...@li...] De la part de Chris Dennett Envoy=E9=A0: lundi 14 f=E9vrier 2005 00:10 =C0=A0: sdl...@li... Objet=A0: [sdljava-users] Problems with JavaSDL.. I've been trying for = hours to get this to work. Hi, I've no idea whatsoever about how to use JavaSDL at all. I=20 downloaded the win32 compiled version, and I've followed the=20 instructions in INSTALL, and yet it still isn't working. My default VM arguments are=20 '-Djava.library.path=3DD:/Programming/eclipse/plugins/org.eclipse.swt.win= 32_3. 1.0/os/win32/x86=20 -Djava.library.path=3D"d:/Java Code/sdljava/lib"', and I've added=20 'sdljava.jar' to the Libraries section classpath of the Java Build Path=20 section of the current project. My testing code, at the moment, is: public static void main(String[] args) { System.loadLibrary("sdljava"); try { SDLMain.init(SDLMain.SDL_INIT_EVERYTHING); } catch (SDLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } and it is giving me: Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java=20 Code\sdljava\ lib\sdljava.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at LoachApp.main(LoachApp.java:10) However.. if I then remove 'System.loadLibrary("sdljava");', I get the=20 following message: Exception in thread "main" java.lang.UnsatisfiedLinkError: = get_SDL_PRESSED at sdljava.x.swig.SWIG_SDLMainJNI.get_SDL_PRESSED(Native Method) at=20 sdljava.x.swig.SWIG_SDLMainConstants.<clinit>(SWIG_SDLMainConstants.java:= 12) at sdljava.SDLMain.<clinit>(SDLMain.java:37) at LoachApp.main(LoachApp.java:11) If anyone has got this working in Eclipse IDE, could someone guide me=20 along? Thanks :D I've attached some screenshots if it helps. --=20 |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: <st...@ta...> - 2005-02-14 00:49:19
|
Hi Chris, Chris Dennett wrote: > By the way, I have doubts about the portability of this code. How many > users are going to mess around with all this if they want to play an SDL > Java game on their system? It seems that Java is a bit wrapped in > obfuscation when it comes to using C libraries. I had to get around this too and my solution was to move the necessary absolute path into the java realm. So for SDL.dll I use System.load() to get the VM to load the native lib. You should be able to make a reasonable assumption about where your app is installed at runtime or you can infer it from classpath/user.dir/etc. This mean you should be able to generate that absolute path just before loading the native SDL lib in the java code. I haven't yet explored whether this would also be a preferable way of loading sdljava.dll though, but do let us know how you get on :) Cheers, Steph -- ================================================================ Stephane Meslin-Weber Email: st...@ta... Software Engineer Web: http://odonata.tangency.co.uk ================================================================ |
From: Chris D. <Des...@nt...> - 2005-02-14 00:37:25
|
Great! The script now works! All I had to do is download SDL from ww.libsdl.org and plonk SDL.dll into my c:\windows\system32 directory. System.loadLibrary("sdljava"); is still required, however. I'll have a go at using it, and use the mailing list again if any other problems arise. By the way, I have doubts about the portability of this code. How many users are going to mess around with all this if they want to play an SDL Java game on their system? It seems that Java is a bit wrapped in obfuscation when it comes to using C libraries. Regards, Chris Robert Schuster wrote: > Hi Chris, > > at first I wonder whether this can work: > > -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 > -Djava.library.path="d:/Java Code/sdljava/lib" > > You should put both absolute filenames in one argument. On Windows you > separate usually with a ; > It should look like: > > -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86;"d:/Java > Code/sdljava/lib" > > --- > > Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java > Code\sdljava\ > lib\sdljava.dll: Can't find dependent libraries > > This one looks like sdljava's JNI library (sdljava.dll) cannot find > SDL itself. If have no idea how you solve that on Windows elegantly. > On GNU/Linux and other Unices we install libraries usually system wide > which is less usually on Windows. > As a workaround you can download SDL's DLLs from libsdl.org and put > them in the same directory as sdljava.dll. > > > cu > Robert -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Robert S. <the...@gm...> - 2005-02-14 00:08:57
|
Hi Chris, at first I wonder whether this can work: -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 -Djava.library.path="d:/Java Code/sdljava/lib" You should put both absolute filenames in one argument. On Windows you separate usually with a ; It should look like: -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86;"d:/Java Code/sdljava/lib" --- Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java Code\sdljava\ lib\sdljava.dll: Can't find dependent libraries This one looks like sdljava's JNI library (sdljava.dll) cannot find SDL itself. If have no idea how you solve that on Windows elegantly. On GNU/Linux and other Unices we install libraries usually system wide which is less usually on Windows. As a workaround you can download SDL's DLLs from libsdl.org and put them in the same directory as sdljava.dll. cu Robert Chris Dennett wrote: > Hi, I've no idea whatsoever about how to use JavaSDL at all. I > downloaded the win32 compiled version, and I've followed the > instructions in INSTALL, and yet it still isn't working. > > My default VM arguments are > '-Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 > -Djava.library.path="d:/Java Code/sdljava/lib"', and I've added > 'sdljava.jar' to the Libraries section classpath of the Java Build > Path section of the current project. > > My testing code, at the moment, is: > > public static void main(String[] args) { > System.loadLibrary("sdljava"); > try { > SDLMain.init(SDLMain.SDL_INIT_EVERYTHING); > } catch (SDLException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > > and it is giving me: > > Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java > Code\sdljava\ > lib\sdljava.dll: Can't find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(Unknown Source) > at java.lang.ClassLoader.loadLibrary(Unknown Source) > at java.lang.Runtime.loadLibrary0(Unknown Source) > at java.lang.System.loadLibrary(Unknown Source) > at LoachApp.main(LoachApp.java:10) > > However.. if I then remove 'System.loadLibrary("sdljava");', I get the > following message: > > Exception in thread "main" java.lang.UnsatisfiedLinkError: > get_SDL_PRESSED > at sdljava.x.swig.SWIG_SDLMainJNI.get_SDL_PRESSED(Native Method) > at > sdljava.x.swig.SWIG_SDLMainConstants.<clinit>(SWIG_SDLMainConstants.java:12) > > at sdljava.SDLMain.<clinit>(SDLMain.java:37) > at LoachApp.main(LoachApp.java:11) > > If anyone has got this working in Eclipse IDE, could someone guide me > along? Thanks :D > I've attached some screenshots if it helps. > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > |
From: Chris D. <Des...@nt...> - 2005-02-13 23:09:00
|
Hi, I've no idea whatsoever about how to use JavaSDL at all. I downloaded the win32 compiled version, and I've followed the instructions in INSTALL, and yet it still isn't working. My default VM arguments are '-Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 -Djava.library.path="d:/Java Code/sdljava/lib"', and I've added 'sdljava.jar' to the Libraries section classpath of the Java Build Path section of the current project. My testing code, at the moment, is: public static void main(String[] args) { System.loadLibrary("sdljava"); try { SDLMain.init(SDLMain.SDL_INIT_EVERYTHING); } catch (SDLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } and it is giving me: Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java Code\sdljava\ lib\sdljava.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at LoachApp.main(LoachApp.java:10) However.. if I then remove 'System.loadLibrary("sdljava");', I get the following message: Exception in thread "main" java.lang.UnsatisfiedLinkError: get_SDL_PRESSED at sdljava.x.swig.SWIG_SDLMainJNI.get_SDL_PRESSED(Native Method) at sdljava.x.swig.SWIG_SDLMainConstants.<clinit>(SWIG_SDLMainConstants.java:12) at sdljava.SDLMain.<clinit>(SDLMain.java:37) at LoachApp.main(LoachApp.java:11) If anyone has got this working in Eclipse IDE, could someone guide me along? Thanks :D I've attached some screenshots if it helps. -- |>>> Dessimat0r /`\ | "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.| ||: | \,/ ||: , | ____--`~--- '--~~__ __ ----~ - ~`---, -~--~ ~---__ ,--~' ~~----___ |
From: Ivan Z. G. <iva...@ya...> - 2005-02-10 02:00:38
|
Hi, I wanted to let you know that I've disabled native code generation (by default) in the Makefiles. If you care about generating the native code yourself enable the appropriate lines in the Makefiles for the modules you may be dealing with. Thanks, -Ivan/ |