Lwjgl - Drawing ???

import org.lwjgl.;
import org.lwjgl.input.
;
public class lwjgltest {
public static void main(String args[]) throws Exception { DisplayMode[] modes = Display.getAvailableDisplayModes(); Display.create(modes[modes.length-1],true); Keyboard.create(); while (true) { Keyboard.poll(); if (Keyboard.isKeyDown(Keyboard.KEY_Q)) { break; } } }}

How do i make this code beable to draw something like a square on the screen?? Itried but i keep getting native code errors…

Take a look at http://java-game-lib.sourceforge.net/documents/tutorials/opengl/skeleton_code.html in the bottom is a skelton example of drawing a box.

Howdy !

Im totally noob with openGL and lwjgl, so i just wanted to get that skeletoncode to work… but :

  1. The constuctor GL() is undefined
  2. The method create(DisplayMode, boolean) is undefined for the type Display
  3. The method destroy() is undefined for the type Display
  4. The method swapBuffers() from the type BaseGL is not visible

Im using lwjgl 0.6 and as far as i can see, i added that lwjgl.jar correctly to my project in eclipse (all the other lwjglstuff in this code seem to work…)

Hope you can leave ma a hint !

Greets !

mbw

tried the 0.7 prerelease?

  • elias

Nope, butnow i tried…didn’t improve the problem

Maybe the skeletton is for a much older version…
is there someting similar for the actual release ?
or tutorials for lwjgl ?

mbw

hmm, guessing here, but you could try the src download and see the examples there (not sure if that’s what you’re doing or not or if they have been updated to 0.7?)

In the 0.6 source download there’s an “examples” directory with some useful stuff - PolygonColoredRotating3D probably covers everything you need to get up and running.

If you’re moving to 0.7 anytime soon, check org.lwjgl.test.opengl.FullScreenWindowedTest in the source download.

Ahhh, finally !!!

thanks for the quick help !

This board ROCKS !!

;D

mbw