How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

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

How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

ElvJOGL
Hi,

I want to know how to convert this pieces of code to JOGL syntax.

I am trying to put together a 3D cube example, and in the instruction from book: OpenGL (3rd Edition): A Primer (by Edward Angel), page 95.

how can I convert this:

glVertexPointer(3, GL_FLOAT, 0, vertices);
glColorPointer(3, G_FLOAT, 0, colors);

bear in mind that both [vertices] and [colors] variables are double float arrays vertices[][] and colors[][].

Could anyone give me the JOGL syntax version.

Once I think I have placed the cude code completely together I will post it in the forum for opinions.

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

Re: How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

elect
Forget that, it's deprecated
Reply | Threaded
Open this post in threaded view
|

Re: How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

ElvJOGL
man is difficult trying to get JOGL code together from openGL textbooks, that seem fine, but are all OUTDATED.

thanks.
Reply | Threaded
Open this post in threaded view
|

Re: How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

elect
ElvJOGL wrote
man is difficult trying to get JOGL code together from openGL textbooks, that seem fine, but are all OUTDATED.

thanks.
You have the opengl bible, that's updated, do that, I can help you
Reply | Threaded
Open this post in threaded view
|

Re: How to convert glVertexPointer(3, GL_FLOAT, 0, vertices) to JOGL syntax

gouessej
Administrator
In reply to this post by ElvJOGL
In my humble opinion, you should split the problem into 2 smaller ones. At first, porting OpenGL C code to JOGL is straightforward most of the time, your very first attempts might be laborious but as time goes by, it will become almost painless as it mainly consists in using GL instances. You can use arrays at the beginning and when you become more comfortable with JOGL, you can always use NIO buffers. Then, you can take some time to switch from the fixed pipeline to the programmable pipeline.

If you try to do everything at the same time, you'll fail.
Julien Gouesse | Personal blog | Website