• Advertisement
Sign in to follow this  

Can someone please walk me through SDL Java setup?

This topic is 4485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to use the Simple DirectMedia Layer with Java. Problem I am having is that I have never setup an external library for java before, and the installation instuctions that come with the binding are extreamly bad - they are either the wrong instructions or very out of date, they refer to files that don't come with the download and refer to the wrong operating system at various points. I am trying to use: SDLJava 0.9.1 Java 1.4.2 Dev-C++ with MingW SDL Devpack So far, I am able run the SDL test program that came with the DevPack. I am missing the library "libiberty.h", but it does not seem to critical at this point. So, yeah... Really don't know where to go from here - Can anyone help unbaffel me?

Share this post


Link to post
Share on other sites
Advertisement
Have you read the docs found here? I don't think you need dev-c++ for any parts of it unless you want to set up sdl for c++ also. I never used sdl with java but I heard that it isn't implemented too well. If you could you might just want to use it with c++. It is very easy to setup in dev-c++.

Share this post


Link to post
Share on other sites
I've never used SDLJava, but setting up external libraries is the same no matter what they are. All you need do is make sure that any jars from the library are on your classpath, and that any native libraries (dlls on Windows, .so on linux) can be specified on the command line with the switch "-Djava.library.path=<path to native libs>" (without the quotes of course). If you are using an IDE like Eclipse or Netbeans, you can set all of this up in the project options. Consult the documentation for your IDE to learn how. If you are compiling from the command line, you can read about how to set up the classpath and everything else you need in the tools documentation for the version of Java you are using.

I suggest you scrap the idea of SDLJava, though. For 2D work, Java2D is quite up to the task and is part of the standard distribution so that you don't need to fuss with external libraries.

Share this post


Link to post
Share on other sites
Well, what I really need is a way to play sounds in java. I'm think that maybe instead messing with the SDLJava wrapper I could just write a couple sound functions in C++ and call them with the JNI.

Share this post


Link to post
Share on other sites
Don't arse around with SDLJava or custom JNI just to play sound files. Sun already has JavaSound and the Java Media Framework. And if those aren't what you want check out JOAL (a Java binding to OpenAL), which you can read more about at javagaming.org. Dig around those forums and you can find loaders for ogg/vorbis and such.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement