Results 1 to 10 of 10

Thread: Cross-platform OpenGL

  1. #1
    Junior Member Newbie Lokken's Avatar
    Join Date
    Jul 2008
    Location
    North Carolina, United States
    Posts
    6

    Cross-platform OpenGL

    Hello All

    I have recently picked up OpenGL again after not having used it since school.

    Back then (~2003) the tool to use to make an opengl program as platform independant as possible was GLUT (or at least thats how I understood it).

    Is this still the case? I dont seem to see any recent updates to it (last i found was 3.7.x in 2001?).

    Are there new tools I am missing? I know GLUT wasnt really designed for full featured 3d applications but for what im going to be doing it will more than suffice, I just dont want to be oblivious to any new developments I may have missed.

    Thanks!

    -Lokken

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Cross-platform OpenGL

    GLUT takes care of opening the windows and acting upon input, so it does not need to be updated often. You still use normal GL calls for the fancy stuff (VBOs, shaders etc).
    If GLUT supports opening windows with multisample support (I don't use GLUT myself), I doubt it needs to be updated.

  3. #3
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Cross-platform OpenGL

    If you want something that is updated more often, use freeglut, its API is the GLUT one and it is still maintained and has fixed some GLUT bugs.

  4. #4
    Member Contributor
    Join Date
    Jul 2008
    Posts
    99

    Re: Cross-platform OpenGL

    Use JOGL to be true cross-platform. Mixed with Swing buttons, etc you can make nice apps. And the best part is that JOGL code is almost identical to OPENGL code.

  5. #5
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Cross-platform OpenGL

    Quote Originally Posted by Z-Knight
    And the best part is that JOGL code is almost identical to OPENGL code.
    Jogl is not almost identical to OpenGL, jogl *is* OpenGL, but for a different programming language (Java).

    Lokken, if you want to write some small apps or demos, use GLFW or (free)GLUT. If you have a larger application, write your system-dependent part yourself.

  6. #6
    Member Contributor
    Join Date
    Jul 2008
    Posts
    99

    Re: Cross-platform OpenGL

    Quote Originally Posted by Zengar
    Quote Originally Posted by Z-Knight
    And the best part is that JOGL code is almost identical to OPENGL code.
    Jogl is not almost identical to OpenGL, jogl *is* OpenGL, but for a different programming language (Java).

    Lokken, if you want to write some small apps or demos, use GLFW or (free)GLUT. If you have a larger application, write your system-dependent part yourself.
    I don't want to argue semantics but that is not exactly true. There are several concepts of OpenGL that are currently either not defined in JOGL or are only placeholders. In addition, the creation of an OpenGL program is different than a JOGL program...I'm referring to how JOGL use the JAVA language and hence it has different conventions for declaring a JOGL instance, etc or the use of listeners for mouse/keyboard/etc interactions. So those part are not directly transferred over from OpenGL the same way. Yes, the basic calls to various routines are nearly identical though I could even point out several that are different because they have additional parameters that OpenGL does not.

    So I stand by my comment that they are not identical but are almost identical.

    I would still recommend JOGL with Swing over any other OpenGL implementation if you are interested in making applications with a user interface (buttons, etc)...you can use GLUI if you tweak it yourself or use Tcl/Tk or Python but I personally don't like to mix and match like that...just my preference.

  7. #7
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Cross-platform OpenGL

    Z-knight, actually, Opengl itself draws nothing, has no knowlegde of inputs and outputs and this make its portability. This knowledge is a added with some tookit like GLUT; whereas JOGL encapsulates all this stuff through some specilized java class, as far as I know.

    There is also Qt to build user interface with opengl in a portable way.

  8. #8
    Member Contributor
    Join Date
    Jul 2008
    Posts
    99

    Re: Cross-platform OpenGL

    good point...you are correct that GLUT serves as the interface, much like JAVA does to OpenGL.

    The main aspect of portability that I prefer with JAVA is that I can use the same development environment on a majority of the major platforms: MAC, Windows, Linux and once I compile my code I can use that code on all of the platforms without having to make any platform specific designs within my code as I would with OpenGL and any user interfaces that exist for it. The convenience is what I like.

  9. #9
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Cross-platform OpenGL

    Z-Knight, you seem to confuse some things here... OpenGL is an API, not an implementation, it defines semantics and syntax of 3D rendering. It is independent of programming language and windowing system. JOGL is simply a library that accesses the OpenGL API from java (and not an OpenGL implementation!), providing some Java-specific wrappers. But the syntax and semantics used by any OpenGL applications are the same, no matter if they are written in java, c, python, perl or haskell, just because the API is strictly defined. There is no doubt tht Java is very portable, but it also goes beyond any discussion that it accesses the API implementation on a particular platform (like win32, mac or linux) using a wrapper library: in this case Jogl (or some other one, there are more to choose from). And if you add some convenient syntactical sugar to make programming more easier, well, it doesn't change the API.

  10. #10
    Member Contributor
    Join Date
    Jul 2008
    Posts
    99

    Re: Cross-platform OpenGL

    Quote Originally Posted by Zengar
    Z-Knight, you seem to confuse some things here... OpenGL is an API, not an implementation, it defines semantics and syntax of 3D rendering. It is independent of programming language and windowing system. JOGL is simply a library that accesses the OpenGL API from java (and not an OpenGL implementation!), providing some Java-specific wrappers. But the syntax and semantics used by any OpenGL applications are the same, no matter if they are written in java, c, python, perl or haskell, just because the API is strictly defined. There is no doubt tht Java is very portable, but it also goes beyond any discussion that it accesses the API implementation on a particular platform (like win32, mac or linux) using a wrapper library: in this case Jogl (or some other one, there are more to choose from). And if you add some convenient syntactical sugar to make programming more easier, well, it doesn't change the API.
    No I'm not confusing things... I know JOGL uses OpenGL and it sits on top, I'm well aware of this. That was never my issue and I think you are confusing what I mean. When I say that JOGL code is NOT exactly the same as OpenGL I am simply saying that the actual code that you write in JOGL will NOT be the same as the OpenGL one. And I'm not referring to the fact that in JOGL you have to define a GL instance and all of the calls like glTranslated(), etc require to be prefixed with the GL instance as in gl.glTranslated()...I'm saying that many calls have additional parameters in JOGL that are not present in OpenGL. For example, glLightfv() takes 3 parameters in OpenGL but 4 in JOGL. This means that your OpenGL code will require extra care to convert to JOGL but that conversion is relatively simply. SO, as I said before, the code is "nearly" identical but not exactly and that was my entire point...and then everyone apparently thought I was saying that JOGL is different from OpenGL much like DirectX is different....to be clear, NO that is not what I intended.

Similar Threads

  1. cross platform opengl code that runs AND compiles
    By mokafolio in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 09-23-2011, 03:55 AM
  2. Cross Platform OpenGL -HOW??!!
    By adityagaddam in forum OpenGL: Advanced Coding
    Replies: 22
    Last Post: 12-29-2002, 11:57 AM
  3. Cross Platform
    By Gavin in forum OpenGL: macOS
    Replies: 2
    Last Post: 10-29-2000, 08:50 PM
  4. OpenGL as a Cross-Platform 2D API?
    By RossB in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 10-03-2000, 06:53 AM
  5. Making OpenGL Apss Cross - platform
    By jadoo in forum OpenGL: Linux
    Replies: 4
    Last Post: 07-20-2000, 05:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean