1、創建工程
- 打開Xcode -> macOS -> Cocoa App
2、刪除文件AppDelegate.h、AppDelegate.m、ViewController.h、ViewController.m、main.m
3、在工程添加GLUT.framework和OpenGL.framework兩個系統庫
4、拖入include文件到當前工程下並將libGLTools.a拖到工程的Frameworks文件夾裏
5、配置CLTool.h和glew.h 的路徑
6、創建main.cpp文件
7、然後在main.cpp中實現下代碼
代碼詳見Demo:https://github.com/JnKindle/OpenGLConfig