PDA

View Full Version : OpenGL Java and C++



nukem
04-04-2003, 04:40 PM
Im in a Java class in school and comming soon we have to make a game. For quite some time Ive been working on a full OpenGL engine in C++ on Linux(no Linux API called only GL). Is there a way I can write Java Lib files for my project so I can still use my C++ code? Is it going to be a problem my school uses win or will I just have to compile DLL's there? Is it even worth it to use OpenGL with Java?

Thanks
Nuke

cix>foo
04-05-2003, 04:39 AM
You can write a Java Native Interface .dll to bind to your existing code. This is a pain and prone to many woes.

What you should really do is investigate the Lightweight Java Game Library (http://java-game-lib.sourceforge.net/) where we've largely done all the horrible stuff for you.

Version 0.6 alpha out shortly with a bunch of fixes.

If you're interested in Java game development using OpenGL (or just Java game development in general) please come and visit our friendly crowd down at http://www.javagaming.org/

We know how to get performance, smoothness, and professionalism out of Java finally, so it's probably worth asking questions in there.

Cas http://www.opengl.org/discussion_boards/ubb/smile.gif

ckline
04-05-2003, 09:04 AM
Is it even worth it to use OpenGL with Java?

Of course it is. As Cas pointed out, you should definitely check out LWJGL.

If you're a comparison shopper, you may also want to check out GL4Java.

Also, a member of Sun's Java team, Apple's java team, and will be presenting a new high performance OpenGL Java binding will be presented at the JavaOne conference in June:
http://servlet.java.sun.com/javaone/sf2003/conf/sessions/display-2125.en.jsp

-chris


[This message has been edited by ckline (edited 04-05-2003).]

[This message has been edited by ckline (edited 04-05-2003).]

cix>foo
04-06-2003, 04:29 AM
I'd also like to ask you all to Vote for Structs (http://developer.java.sun.com/developer/bugParade/bugs/4820062.html) or we'll never see the same performance and ease-of-use as you get in C. You know it makes sense! (If you don't understand the RFE then vote for it anyway please! You'll be doing us all a huge favour even if you don't know why)

Cas http://www.opengl.org/discussion_boards/ubb/smile.gif

nukem
04-07-2003, 11:49 AM
I tryed lwjgl at school and on my comp. My comp gives me this
[nuke@NUKE lwjgl-0.5]$ java -cp examples.jar lwjgl.jar MovingStarBitmaps
Exception in thread "main" java.lang.NoClassDefFoundError: lwjgl/jar

I cannt put the ; in because in linux that means another command. At school it couldnt resize the window, probly because of the permissions the only OGL apps that worked there was SDL.

GL4Java never worked for me. It seems that sun is going to put OGL into java that seems kool.