The method glLoadIdentity() is undefined for the type GL

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

The method glLoadIdentity() is undefined for the type GL

LightHades
Hello
I'm new at JOGL and I'm trying to build a project with Eclipse. I've exported all the .jar's I need (I think :/) and the natives too, but at the lines:
(gl is GL)

gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glMatrixMode(GL.GL_MODELVIEW);

it says "The method glLoadIdentity() is undefined for the type GL" and also that GL_MODELVIEW and GL_PROJECTION "cannot be resolved or is not a field"... I dont know what .jar's to add... here's all the code:

lesson1.java

I've also tried to use GL.GL_SMOOTH and says "GL_SMOOTH cannot be resolved or is not a field" too ....
help please :/

Can someone tell me exactly, what ".jar's" and ".dll's" i have to add and exactly where to download 'em? Thanks :)
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
Hi

You seem to make a confusion between JOGL 1 and JOGL 2. glMatrixMode is in GL2. Look at the documentation.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
This post was updated on .
Can you give me a link or tell me where are the libraries for JOGL1 please? :)

pd: It's not that i confused, it's that the tutorials i've read didn't speak about any "version" x)

Thanks

edit: Ok i got 'em from here http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1a/ , them are the more updated ones?
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
DON'T USE JOGL 1 AS IT IS NOT MAINTAINED ANYMORE! We can help you to switch to JOGL 2.0 and you should do it. As JOGL 1 is not maintained, we cannot guarantee that it will work under any recent OS, it is already completely broken under Mac, it might get broken under Windows 8, JOGL 1 is dead.

The latest aggregated build (of JOGL 2.0) is here:
http://jogamp.org/deployment/archive/master/gluegen_600-joal_366-jogl_833-jocl_691/archive/

Edit.: Just do GL2 gl = d.getGL2(); it is not very difficult.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
I have to download "jogamp-all-platforms.7z"? I'll give it a try
pd: Which .jars i've to add for building in win32?
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
This post was updated on .
Please read our wiki, especially this page. You need gluegen-rt-natives-windows-i586.jar, jogl-all-natives-windows-i586.jar, jogl-all.jar and gluegen-rt.jar.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
Well, thanks :) Yesterday when i tried it it worked. I'm testing with a tutorial with a lot of examples, a great one, but the only thing it fucks me is that is for JOGL 1, so i have to write getGL2(). all the time in some functions x)

Thanks for the help.
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
Let us know which tutorials you use and maybe we can help you to port them to JOGL 2.0. Don't forget to use GLUgl2 instead of GLU because some methods are only implemented in the former.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
Dont worry, i have ported all the tutorials i am reading :D but now I need a tutorial/guide about how to create a complete (and simple) game with all the needed things by the games (like saving data, changing settings,...)

(i was following this tuts: http://robot.unipv.it/index.php/didattica/grafica-3d/54 , which are more like examples, but they work great for learning, i think)
pd: Do u know about some other site or books about JOGL? Not just for making games, but basics aspects of JOGL and such
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
Hi once again!
I am trying to port this code (from JOGL wiki):
https://docs.google.com/file/d/0B9hhZie2D-fENGE3ZmZkOGItZGYzZC00ZDgzLTg0NTAtMTk1MTAwMzYxYzNk/edit?hl=en
to JOGL2 (it's JOGL1, isn't it?) but i can't! D: I mean, the Key and Mouse listeners aren't working, dunno why. Here's the code of Main.java and Game.Java:

http://www.sourcepod.com/atoyan01-11690
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
Rather add the listener to the frame if it doesn't work on the canvas.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
Thanks! It works pretty well right now.
I have another question:
How I can do some sort of "speed" or something like that? So, making a drawing "move" on each display call if the users press "A" or "W", ... I have to do it with Animators?
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
Use the key listener to detect key pressed events of course and modify the model-view matrix or call glTranslate to "move" something. I advise you to learn the basic concepts of OpenGL before using JOGL.

Edit.: It can be done in a vertex shader too but I'm not the best person who can speak about that.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

LightHades
Well, thanks for the reply

I actually know that concepts, the thing that i dont know, is how i actually do to know the "real" time passed since the last display call. I know that the display method will be called at different speed depending on each computer's speed, so, i want to know what function I need

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: The method glLoadIdentity() is undefined for the type GL

gouessej
Administrator
You can measure the elapsed time with successive calls to System.nanoTime() and you may need a hack to force Windows to use its high precision timer.
Julien Gouesse | Personal blog | Website