porting JOGL 1 code into JOGL 2.0

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

porting JOGL 1 code into JOGL 2.0

JOGL_Noob
Hello,

I have a project I am trying to rebuild to use JOGL 2.0
I am currently seeing a lot of methods in javax.media.opengl.GL that are used in JOGL 1.x code that are no longer there in JOGL 2.0. Is there some guide that shows how to do this systematically?
If not what sources would you recommend for a total JOGL noob :) ?

From what I understand JOGL 1.0 is associated with OpenGL 1.0 and JOGL 2.0 is OpenGL 4.0?
Would a book on each help understand the differences?

I am using a windows build for JOGL 2 from around July 2011 from joamp site.

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

Re: porting JOGL 1 code into JOGL 2.0

gouessej
Administrator
Hi

Please use a more recent build, at least the RC5.

JOGL 1.1.1a supported OpenGL version 1.1 to 2.1 and JOGL 2.0 supports OpenGL 1.1 to 4.x.

Porting a source code from JOGL 1 to JOGL 2 is quite straightforward, you have to replace the use of GL by the use of its child classes, GL2 for example, this is the same for constants. BufferUtils has been renamed Buffers. Some classes have been moved into subpackages. I ported 2 engines and some APIs, it's a boring task but it is not very difficult except to make threading work in some particular cases.

You can look at the example I posted on Wikipedia and the demos on the repository might be interesting for you too. Best regards.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: porting JOGL 1 code into JOGL 2.0

Demoscene Passivist
Administrator
In reply to this post by JOGL_Noob
>Is there some guide that shows how to do this systematically?

As far as I know not :( But no panic its quite easy. Just a little refactoring here and there. 95% is just rename/move refactoring. The other 5% are some changes to the method signatures and ofcourse the OpenGL profile stuff introduced with JOGL2.

>From what I understand JOGL 1.0 is associated with OpenGL 1.0 and JOGL 2.0 is OpenGL 4.0?

For a beginner the differences doesn't really matter. If u are not using multiple platforms or advanced OpenGL stuff like geometry shaders, tesselation and atomic counters u can simply syntactically refactor ur code, add some profile code and u are good to go

>Would a book on each help understand the differences?

I wouldn't borther with any books. Better directly dive in  But u may have a look at the wiki and maybe my JOGL2 code repository. I also recommend taking a look at the unit tests for JOGL as they more or less explain every aspect of JOGL2 with code

Also feel free to post any further questions in this forum
Reply | Threaded
Open this post in threaded view
|

Re: porting JOGL 1 code into JOGL 2.0

Sven Gothel
Administrator
On 02/03/2012 03:31 PM, Demoscene Passivist [via jogamp] wrote:
>
>
>> Is there some guide that shows how to do this systematically?
>

Well there is something called, jackpotc [jogl/tools/jackpotc] within
the JOGL repos. It supposed to translate a JOGL1 project to JOGL2.
However, the setup is currently unmaintained - but you may try.
If you choose to do so .. pls give us feedback and send us your changes
to the setup .. if any.

> As far as I know not :( But no panic its quite easy. Just a little
> refactoring here and there. 95% is just rename/move refactoring. The other
> 5% are some changes to the method signatures and ofcourse the OpenGL profile
> stuff introduced with JOGL2.
>
>>From what I understand JOGL 1.0 is associated with OpenGL 1.0 and JOGL 2.0
> is OpenGL 4.0?
>
> For a beginner the differences doesn't really matter. If u are not using
> multiple platforms or advanced OpenGL stuff like geometry shaders,
> tesselation and atomic counters u can simply syntactically refactor ur code,
> add some profile code and u are good to go
in this case, just use GL2 .. ie "GL gl2 = gl.getGL2();"
for example.

>
>> Would a book on each help understand the differences?
>
> I wouldn't borther with any books. Better directly dive in  But u may have a
> look at  http://jogamp.org/wiki/index.php/Jogl_Tutorial the wiki  and maybe
> https://github.com/demoscenepassivist/SocialCoding/tree/master/code_demos_jogamp
> my JOGL2 code repository . I also recommend taking a look at
> https://github.com/sgothel/jogl-demos 

Location of JOGL's unit tests, within JOGL's git repo:
<http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit>

> the unit tests for JOGL  as they more
> or less explain every aspect of JOGL2 with code
>
> Also feel free to post any further questions in this forum
>


signature.asc (910 bytes) Download Attachment