更新时间:2023-11-10 16:55:52
您需要在OS X上包含<OpenGL/gl3.h>
才能使用OpenGL 3.2核心API调用.请注意,如果同时包含<OpenGL/gl.h>
和<OpenGL/gl3.h>
,则可能会收到编译器警告,这是因为gl3.h
具有两个目的:
You need to include <OpenGL/gl3.h>
on OS X in order to use OpenGL 3.2 core API calls. Be aware that if you include both <OpenGL/gl.h>
and <OpenGL/gl3.h>
you may receive a compiler warning, this is because gl3.h
serves two purposes:
它们实际上是互斥的,正确的标头取决于您使用的上下文版本:
They are effectively mutually exclusive, the proper header depends on the context version you are using:
#include <OpenGL/gl.h>
#include <OpenGL/gl.h>
#include <OpenGL/gl3.h>