Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: Port GLUT to GLX

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    5

    Port GLUT to GLX

    Greetings,

    I work for a university and a project I am working on includes updating the libraries for the example OpenGL programs that will be used by a professor. GLX was recommended to me. I don't know anything about OpenGL however, so if anyone has any idea how to port a program that uses GLUT to GLX (replacing the GLUT initialization fragment with the equivalent in GLX), any help would be appreciated.

    Some of the programs include:
    http://pastebin.com/f22abd61
    http://pastebin.com/f5daebe49

    Thanks

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Port GLUT to GLX

    Why ? Would better port to freeglut.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    5

    Re: Port GLUT to GLX

    Any reason why freeglut would be more long term term or better than GLX? In any case can someone point me in the direction to find how to port programs over from glut to either GLX or Freeglut?

  4. #4
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    5

    Re: Port GLUT to GLX

    ..or is FreeGLUT backwards compatible? What's trying to be avoided is using obsolete libraries.

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Port GLUT to GLX

    reason freeglut is longer term : it is truly opensource. and has less bugs.
    freeglut is a drop-in replacement of the original glut. most current linux distributions use it in place of the original glut.
    RTFM :
    http://freeglut.sourceforge.net/

  6. #6
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    5

    Re: Port GLUT to GLX

    Thanks for your help. I'm looking into porting the files to freeglut but am having some issues.

    I originally include:

    #include <stdlib.h>
    #include <FL/glut.H>
    #include <GL/glu.h>
    #include <unistd.h>

    for the square program. (link in first post)

    I added:

    #include <GL/freeglut.h>

    and when I goto compile, the only error I am getting is

    Compiling squareF.cxx...
    squareF.cxx:6:25: error: FL/glut.H: No such file or directory
    make: *** [squareF.o] Error 1

    Is there a different "include" I should be using instead of FL/glut.h

    I have no problems on the Solaris machines running GLUT.

    Thanks.

  7. #7
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Port GLUT to GLX

    FL ? This is not from glut, but from FLTK apparently. I don't know much about this. You should be able to replace it by freeglut.h ...

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

    Re: Port GLUT to GLX

    Code :
    #include <FL/glut.H>

    Hum, very nice, I love the 'H' in capital.

    On freeglut project website, they recommend to do this:

    Code :
    #ifdef FREEGLUT
    #include <GL/freeglut_ext.h>
    #else
    #include <GL/glut.h>
    #endif

    And remove the FL/glut.H

  9. #9
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    5

    Re: Port GLUT to GLX

    Ok,
    I'm currently getting:

    Code :
    Linking squareF...
    g++: unrecognized option '-R/usr/openwin/lib'
    /usr/bin/ld: cannot find -lsocket
    collect2: ld returned 1 exit status
    make: *** [squareF] Error 1

    as the problem. I have freeglut installed on this machine now.

    Thanks again for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •