Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.02 KB

README.md

File metadata and controls

32 lines (23 loc) · 1.02 KB

Summary

Have you ever wanted to program an OpenGL app on macOS? Would you like to do it without XCode or .nib files or storyboards? Would you like someone to present you with the bare minimum code that you need to get started? If "YES!" is the answer to any of those questions, this repo is for you!

Example code is provided for both legacy and core contexts. Note that the only real difference between legacy and core contexts is:

  NSOpenGLPixelFormatAttribute Profile = NSOpenGLProfileVersionLegacy;
  // vs
  NSOpenGLPixelFormatAttribute Profile = NSOpenGLProfileVersion4_1Core;

and of course the loading of OpenGL extensions for the core context.

Note that this repo does not intend to give you a tutorial on OpenGL, it only aims to guide you through context creation with only native APIs.

Opengl triangle image

Building and running

The shell script build.sh will build both the legacy and modern examples.

sh build.sh
build/legacy
build/modern