Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Installing OpenGL and GLUT on a Mac?

  1. #1
    Guest

    Installing OpenGL and GLUT on a Mac?

    Does anyone know how exactly I'd do this? I've been reading up, and everything seems to point to the apple website. I've downloaded what people said to download, but it doesn't seem to have anything I can actually INSTALL with, just things that I'm supposed to install somehow. Try as I might, I haven't been able to find a guide that actually explains how I'm supposed to get it all working. Does anyone know?

    Thanks,
    Spidy

  2. #2
    Junior Member Newbie
    Join Date
    May 2006
    Location
    Louisiana
    Posts
    12

    Re: Installing OpenGL and GLUT on a Mac?

    I program opengl on my powerbook and it required no setup... opengl & glut are already installed with the operating system.. you just need to include it in your projects.

  3. #3
    Guest

    Re: Installing OpenGL and GLUT on a Mac?

    According to the tutorial I've been working with, all I had to include was

    Code :
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <GL/glut.h>
    #include "tk.h"
    But that doesn't seem to work. Do I have to compile it some special way or something? Termain commands like "which glut" and "which opengl" return nothing, so I'm not 100% sure they're already installed.

    When I try to compile code with those includes, it throws an error about the files I'm including not existing.

    Spidy

  4. #4
    Junior Member Newbie
    Join Date
    May 2006
    Location
    Louisiana
    Posts
    12

    Re: Installing OpenGL and GLUT on a Mac?

    I believe you used a windows guide.

    change that to say
    #include <GLUT/glut.h> // thats it

    And in xcode you need to set up a package to include OpenGL.framework and GLUT.framework
    Right-click the project file in xcode and click add frameworks.. and browse to them

  5. #5
    Member Newbie
    Join Date
    Jan 2006
    Location
    Pacific Northwest
    Posts
    38

    Re: Installing OpenGL and GLUT on a Mac?

    Yes, you do not need those other headers you previously posted (gl.h, glu.h).

    And when you are creating an Xcode project, the easiest way to do it is create an empty project, add a Carbon target, add all your source code files, then add the frameworks "Cocoa", "GLUT", and "OpenGL", and then you're set to go!

    Also, you can follow the NeHe tutorial found on my website (once you've done that, you can move right on to NeHe lesson 2):
    http://dhost.info/joetheprogrammer/w...ss/?page_id=47
    (sometimes it's down because of excess traffic, so if that happens, try again later)
    "The first person to succeed is the first person to make 100 mistakes" - Albert Einstien

  6. #6
    Guest

    Re: Installing OpenGL and GLUT on a Mac?

    it was a NeHe tutorial in the first place...must have clicked the wrong one. I'm using Smultron for my editing though, is there anything different I need to do because of that?

    Spidy

  7. #7
    Guest

    Re: Installing OpenGL and GLUT on a Mac?

    Sorry for the double post, but I've edited the file and tried compiling, only to get these errors:

    Code :
    /usr/bin/ld: Undefined symbols:
    DrawGLScene()
    ReSizeGLScene(int, int)
    InitGL()
    _glutCreateWindow
    _glutDisplayFunc
    _glutInit
    _glutInitDisplayMode
    _glutInitWindowPosition
    _glutInitWindowSize
    _glutMainLoop
    _glutReshapeFunc
    collect2: ld returned 1 exit status

  8. #8
    Junior Member Newbie
    Join Date
    May 2006
    Location
    Louisiana
    Posts
    12

    Re: Installing OpenGL and GLUT on a Mac?

    I don't know DrawGLScene() to be a function of OpenGL.. that's something you need to define... (i could be wrong on that)

    Code :
    int main (int argc, char **argv) {
    glutInit (&amp;argc, argv);
    glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
    glutInitWindowSize (1024, 640);
    glutInitWindowPosition (100, 100);
    glutCreateWindow ("jamesonquave.com");
    glutFullScreen();
    init();
    createLights();
    glutDisplayFunc (display);
    glutIdleFunc (display);
    glutReshapeFunc (reshape);
    glutMainLoop ();
    return 0;
    }

  9. #9
    Guest

    Re: Installing OpenGL and GLUT on a Mac?

    After changing the main() block to what you suggested, it threw these errors:

    Code :
     test.cpp: In function 'int main(int, char**)':
    test.cpp:24: error: 'init' was not declared in this scope
    test.cpp:25: error: 'createLights' was not declared in this scope
    test.cpp:26: error: 'display' was not declared in this scope
    test.cpp:28: error: 'reshape' was not declared in this scope

  10. #10
    Junior Member Newbie
    Join Date
    May 2006
    Location
    Louisiana
    Posts
    12

    Re: Installing OpenGL and GLUT on a Mac?

    again, those are functions that you have to write yourself.. i cant write the entire program for you.. thats just a skeleton...
    init, createLights, display, and reshape are all things that you need to write somewhere else... (createLights is optional)

Page 1 of 2 12 LastLast

Similar Threads

  1. glut.h not found after installing glut
    By SagoO in forum OpenGL: General
    Replies: 8
    Last Post: 11-13-2010, 08:04 PM
  2. Installing opengl and glut
    By omyyyyy in forum OpenGL: Windows
    Replies: 4
    Last Post: 03-18-2010, 12:27 AM
  3. installing glut
    By Samanosuke in forum OpenGL: General
    Replies: 2
    Last Post: 09-24-2002, 05:26 PM
  4. installing glut
    By Zal in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-08-2002, 07:06 PM
  5. installing glut
    By anal_retention in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-06-2001, 09:25 PM

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