I'm using GLFW 3.0 on Mac OS X 10.8, graphic card is Intel HD Graphics 5000
And my OpenGL API version is 2.1, aquired by
glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR);
glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR);
Compiling options:
g++ ... -framework OpenGL -framework Cocoa -framework IOKit ...
Headers:
#include <GLFW/glfw3.h>
#include <GL/glu.h>
The version is always 2.1, unlike the reported 3.2. My OS has been upgraded to 10.9, and OpenGL version is still 2.1.
It still cannot compile GLSL 3.3, while Apple says it supports 4.1. How do I access higher versions of the library?
According to Apple, OpenGL is no longer supported. However, it appears v4. 1 of OpenGL was supported on many devices as of July 28, 2020.
Technically, you cannot get a (windowed) OpenGL 3.2 context programming purely in C on OS X. You have to use part of Cocoa (an Objective-C framework) called NSOpenGL; AGL (deprecated C-based API) as well as the really old X server implementation (XQuartz) are perpetually limited to OpenGL 2.1.
Open OpenGL Extensions Viewer. In the Tasks menu, click Summary. You can test the OpenGL version for your GPU by looking at the 4.6 and lower level version: example: The GPU has a 4.6/4.5 level OpenGL version.
OpenGL was deprecated in macOS 10.14 which means that Apple will no longer develop newer versions of OpenGL for macOS. However, you can still run OpenGL 4 natively on higher versions such as macOS 10.15.
You need to add both "forward_compat" and "core_profile" hints before creating the window.
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwCreateWindow(640, 480, "Hello World", NULL, NULL );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With