Lesson 0b: Getting OpenGL Set Up on Mac OS X
- Summary
- *
- Text version
- *
- Download source
Getting OpenGL and GLUT Set Up
Compiling and Running the Test Program
Let's make sure that OpenGL works. Download the source code for this later lesson and extract it to any folder (e.g. using Finder). Then, from the command-line, use "cd" to change to the directory where you extracted it. Enter "make" to compile the program, and make sure there are no error messages. Then, enter "./cube" to run the program, and make sure that it runs. Press ESC to exit the program when you're done.
Compiling and Editing
To my knowledge, the standard way of editing and compiling a C++ program in Mac is to edit it with a text editor, such as TextEdit, or Emacs or Vim for advanced users, and compiling it using the "make" command like in the previous section. (Unfortunately, I don't know of any better text editors out there for Mac.)
Makefile
Look at the contents of "Makefile" in the source directory. It is an important file used by "make" to figure out how to compile our program. The line "PROG = cube" tells "make" that we want the executable file to be called "cube". The line "SRCS = main.cpp imageloader.cpp" tells "make" the files that we need it to compile. You'll have to edit these lines if you ever want to change the name of the executable or change the source files that "make" compiles.
Next is "Part 1: The Basics".
- Summary
- *
- Text version
- *
- Download source