the_jogler
Guest
|
 |
«
Posted
2007-09-02 00:23:41 » |
|
How is LWJGL different than JOGL? I know LWJGL is a game engine, but doesn't Java already have support for input and things like that, so why even use a game engine (like LWJGL)? Isn't that like reinventing the wheel? I would just like to know how LWJGL is so different than just using something else, such as JOGL. This is probably a really dumb question, but please bear with me. Thanks.
Edit: I can't find too many tutorials, either. I've tried that NeHe website, but when I download all I get is a .jar fle.
|
|
|
|
|
cylab
|
 |
«
Reply #1 - Posted
2007-09-02 01:04:37 » |
|
LWJGL and JOGL were developed in parallel, so they both invented the wheel in the first time  JOGL is some more official, since sun is involved in the development and LWJGL is more community driven. JOGL is "only" an OpenGL binding, while LWJGL also adds sound and input processing not available in standard JRE, like Joystick support and a more direct input response. There are other differences in window/fullscreen handling etc. and I think the majority of people here consider LWJGL more suited for games, while JOGL is more suited for integration in Desktop Apps like 3D-Editors or Visualization.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
the_jogler
Guest
|
 |
«
Reply #2 - Posted
2007-09-02 01:38:45 » |
|
Thanks. But it's kind of hard to find tutorials for LWJGL, seeing as how the wiki doesn't really have tutorials on how to use LWJGL, and the information it does have just kind of makes you jump right in and doesn't really explain things. And why not just use Java 3D or something like that?
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Matzon
|
 |
«
Reply #3 - Posted
2007-09-02 02:06:42 » |
|
Thanks. But it's kind of hard to find tutorials for LWJGL, seeing as how the wiki doesn't really have tutorials on how to use LWJGL, and the information it does have just kind of makes you jump right in and doesn't really explain things. And why not just use Java 3D or something like that?
this is pretty straightforward... http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicopenglthe rest is just OpenGL ...
|
|
|
|
f.l.x
|
 |
«
Reply #4 - Posted
2007-09-02 02:17:10 » |
|
Edit: I can't find too many tutorials, either. I've tried that NeHe website, but when I download all I get is a .jar fle.
jar files are just zipped (or pack2000) files, unzip with wathever compression software you are used to and ther you are
|
|
|
|
oNyx
|
 |
«
Reply #5 - Posted
2007-09-02 03:36:03 » |
|
>LWJGL and JOGL were developed in parallel, so they both invented the wheel in the first time[...]
LWJGL exists longer.
>jar files are just zipped (or pack2000) files[...]
Jars are Zip files with an optional meta-inf/manifest.mf entry. The file extension for Pack200 (not 2000) is "pack". It doesn't make any sense to distribute files in that flavor, however. You either use GZip compression on top or a different compression scheme (and "pack" files are only a sub step if you take that route - otherwise it's "pack.gz").
|
|
|
|
the_jogler
Guest
|
 |
«
Reply #6 - Posted
2007-09-03 06:58:33 » |
|
So how do I turn a .jar file into something I can read and understand?
|
|
|
|
|
Matzon
|
 |
«
Reply #7 - Posted
2007-09-03 07:43:27 » |
|
just extract it using a zipping program. You might have to rename the file to .zip
|
|
|
|
flipperke
|
 |
«
Reply #8 - Posted
2007-09-03 13:27:50 » |
|
Or, on the console, type: 1
| jar -xvf jarred_file.jar |
|
|
|
|
|
Galgalid
Senior Newbie 
L33T
|
 |
«
Reply #9 - Posted
2007-10-27 16:19:06 » |
|
Got a question: I've tried using lwjgl with both NetBeans and JCreator...but it's not working. I followed the installation guides for both IDE's( http://lwjgl.org/installation.php) but it's still not working. Funny thing is that it has worked before, so I know I'm doing it right. I used this example to test lwjgl: http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicopenglIn JCreator I get the following error message: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| --------------------Configuration: Space Invaders - j2sdk1.4.2_15 <Default> - <Default>-------------------- java.lang.NoClassDefFoundError: Game (wrong name: game) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) Exception in thread "main" Process completed. |
and in NetBeans IDE 5.0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\eng06itara\Game\build\classes
compile:
run:
java.lang.NoClassDefFoundError: C:\Documents
Exception in thread "main"
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds) |
And yes, I have entered the correct path to lwljgl1.1.2(C:\Documents and Settings\eng06itara\Skrivbord\lwjgl-1.1.2\lwjgl-1.1.2) Please help me 
|
I've never before built a program this stable, this secure, this L33T....
I want to be a member of the Sega Black Ops Team!
|
|
|
Games published by our own members! Check 'em out!
|
|
GDX
Senior Newbie 
|
 |
«
Reply #10 - Posted
2007-10-27 18:38:35 » |
|
I haven't used NetBeans or JCreator, but I have seen errors like those before...
The first error is a classpath issue and so if you can find a way to configure the classpath for the java command that is used to run the code, I think it may resolve the issue.
The second error looks like it has to do with a file path that uses spaces. Notice how the error message cut off the path right after C:\Documents? If you can quote the path, as in... java -classpath "C:\Documents and Settings\eng06itara\Game\build\classes" (full name of class w/package), it should work.
As I said, I haven't used those IDEs and so hopefully someone can answer for those specifically, but I thought these suggestions might help you.
|
|
|
|
|
Galgalid
Senior Newbie 
L33T
|
 |
«
Reply #11 - Posted
2007-10-27 22:38:59 » |
|
Now I get the following message in JCreator: 1 2 3 4 5 6
| java.lang.NoClassDefFoundError at Game.cleanup(Game.java:105) at Game.main(Game.java:40) Exception in thread "main" Process completed. |
here's the code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
| import org.lwjgl.Sys; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11;
public class Game { public static final String GAME_TITLE = "My Game"; private static final int FRAMERATE = 60; private static boolean finished; private static float angle; public static void main(String[] args) { boolean fullscreen = (args.length == 1 && args[0].equals("-fullscreen")); try { init(fullscreen); run(); } catch (Exception e) { e.printStackTrace(System.err); Sys.alert(GAME_TITLE, "An error occured and the game will exit."); } finally { cleanup(); } System.exit(0); } private static void init(boolean fullscreen) throws Exception { Display.setTitle(GAME_TITLE); Display.setFullscreen(fullscreen); Display.setVSyncEnabled(true); Display.create(); } private static void run() { while (!finished) { Display.update(); if (Display.isCloseRequested()) { finished = true; } else if (Display.isActive()) { logic(); render(); Display.sync(FRAMERATE); } else { try { Thread.sleep(100); } catch (InterruptedException e) { } logic(); if (Display.isVisible() || Display.isDirty()) { render(); } } } } private static void cleanup() { Display.destroy(); } private static void logic() { if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { finished = true; } angle += 2.0f % 360; } private static void render() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT); GL11.glPushMatrix(); GL11.glTranslatef(Display.getDisplayMode().getWidth() / 2, Display.getDisplayMode().getHeight() / 2, 0.0f); GL11.glRotatef(angle, 0, 0, 1.0f); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex2i(-50, -50); GL11.glVertex2i(50, -50); GL11.glVertex2i(50, 50); GL11.glVertex2i(-50, 50); GL11.glEnd(); GL11.glPopMatrix(); } } |
Maybe i should just try to re-install everything and clean up the mess it has turned into and then give it another try 
|
I've never before built a program this stable, this secure, this L33T....
I want to be a member of the Sega Black Ops Team!
|
|
|
princec
|
 |
«
Reply #12 - Posted
2007-10-28 14:35:00 » |
|
You simply don't have the lwjgl.jar in your runtime classpath; and/or the lwjgl.dll, which needs to be pointed at with -Djava.library.path Cas 
|
|
|
|
Galgalid
Senior Newbie 
L33T
|
 |
«
Reply #13 - Posted
2007-10-28 21:31:58 » |
|
Okay....I tried that command -Djava... and the window creation worked. Then I tried compiling the openGL-test from the cmd, but I got errors. All of them because org.lwjgl.* wasn't found. What do I do now?
btw, gonna try to get it working with JCreator and Netbeans within 2 hours.
|
I've never before built a program this stable, this secure, this L33T....
I want to be a member of the Sega Black Ops Team!
|
|
|
Galgalid
Senior Newbie 
L33T
|
 |
«
Reply #14 - Posted
2007-10-29 00:18:32 » |
|
It's working now  In Netbeans. Good thing, cause I don't like JCreator 
|
I've never before built a program this stable, this secure, this L33T....
I want to be a member of the Sega Black Ops Team!
|
|
|
|