Simple C program to demonstrate OpenGL on OS X. It looks kinda like this:
.
├── Makefile # Handles compiling the project.
├── README.md
├── bin
│ └── hello_open_gl # Compiled program, OpenGL example :)
└── source
├── main.c # Core application file that draws the triangle.
├── xsys.c # Wrapper methods around system calls.
└── xsys.h
This installation guide assumes you have homebrew.
X11
is the windowing system that used to ship with Mac OS X by default, but
this is no longer the case. Simply download
X11
and run the installer.
glfw3
is an open source, cross platform, library for creating and managing
windows with an OpenGL
context. This means that it relies heavily on the
windowing system provided by X11
.
$ brew tap homebrew/versions
$ brew install glfw3
Next let's install glew
. This provides a small layer between our code and
OpenGL
.
$ brew install glew
Finally once the dependencies are installed you can run make in the root of the project folder.
$ make
$ ./bin/hello_open_gl