LWJGL
May 19, 2013, 16:31:43 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: N00b problem - display error. [resolved]  (Read 2631 times)
SgtSparky
Newbie
*
Posts: 5


« on: July 22, 2009, 07:12:27 »

Hello, I believe I'm doing something incredibly wrong here, but I'm not sure what.
Here's what I've done:
1. Created a new project in eclipse.
2. Referenced all the external lwjgl jar files.
3. Copy and pasted all the simple rendering code into a Main.java file (I just renamed the class).
4. Attempted to run this code.

The only errors I get from this are exceptions having to do with destroying the display:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.opengl.Display -- I bet it is the issue, but I'm not sure how to solve it.
   at t2.Main.cleanup(Main.java:107) -- Actual code: "Display.destroy();"
   at t2.Main.main(Main.java:42) -- Actual code: "cleanup();"

The only thing I really want is to get right now is rendering with primitives so that I can visually test my engine (t2) as I work on it.

Thanks and sorry,
--SgtSparky
Logged
broumbroum
Prolific Timewaster
****
Posts: 316



WWW
« Reply #1 on: July 22, 2009, 13:42:02 »

your runtime classpath should be notified of lwjgl.jar and others. Wink
Logged

Sf3JSwing project, code repo (Apache License) -  http://www.sourceforge.net/p/sf3jswing
Sf3jswing Project Forum - http://apps.sourceforge.net/phpbb/sf3jswing/
SgtSparky
Newbie
*
Posts: 5


« Reply #2 on: July 22, 2009, 13:46:10 »

your runtime classpath should be notified of lwjgl.jar and others. Wink

I tried adding all the .jar files to my class-path but I still get the same errors. Sad
I might be doing something horribly wrong with eclipse. I'm going to try experimenting.

Edit: This image might help a bit.

EDIT again: YAY! I get a window to pop up, but nothing will show up. Sad Time for more experimenting..
Logged
princec
Nerdus Imperius
*****
Posts: 1867



WWW
« Reply #3 on: July 23, 2009, 03:39:32 »

Ah that simple rendering code is missing a call to gluOrtho2D to set up an orthographic display projection (ie. normal 2D coordinates). LWJGL 1.x used to do that at init, but 2.x no longer does (probably not a wise move on reflection).

Cas Smiley
Logged

broumbroum
Prolific Timewaster
****
Posts: 316



WWW
« Reply #4 on: July 23, 2009, 05:17:30 »

Classpath seems ok, maybe you have a file that is elsewhere and overlapping the classpath entries. That may be somewhere in a bootstrap entry : have a look at jre/lib/ext or jdk/jre/lib/ext folders. Also, if you've downloaded a .jnlp and exited by mistake while loading it may be possible that you have to cleanup the java caches in the Java panel.
Logged

Sf3JSwing project, code repo (Apache License) -  http://www.sourceforge.net/p/sf3jswing
Sf3jswing Project Forum - http://apps.sourceforge.net/phpbb/sf3jswing/
SgtSparky
Newbie
*
Posts: 5


« Reply #5 on: July 23, 2009, 10:17:41 »

Classpath seems ok, maybe you have a file that is elsewhere and overlapping the classpath entries. That may be somewhere in a bootstrap entry : have a look at jre/lib/ext or jdk/jre/lib/ext folders. Also, if you've downloaded a .jnlp and exited by mistake while loading it may be possible that you have to cleanup the java caches in the Java panel.

I solved my compile problem yesterday, but thanks for replying. Smiley
I also solved my display issue: I had to set up glViewPort and glOrtho to fix positioning issues. (Nothing was showing up because the coordinates translation)

Now I have one problem left: How do I get my display to NOT be the size of my desktop? Are there some arguments I can pass on run-time?
Logged
princec
Nerdus Imperius
*****
Posts: 1867



WWW
« Reply #6 on: July 24, 2009, 05:50:41 »

Use the create() method on Display that takes a DisplayMode, and construct a DisplayMode with whatever dimensions you want to use to give it.

Cas Smiley
Logged

SgtSparky
Newbie
*
Posts: 5


« Reply #7 on: July 24, 2009, 10:53:49 »

Use the create() method on Display that takes a DisplayMode, and construct a DisplayMode with whatever dimensions you want to use to give it.

Cas Smiley

Thanks, problem solved!
..But now I feel like even worse of a noobie for not seeing that in the documentation.  Embarrassed
Oh well, I'm on my way to having a good understanding of lwjgl! Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!