Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: OpenGL on Mac OSX Mojave 10.14

  1. #1
    Newbie Newbie
    Join Date
    Aug 2018
    Posts
    2

    OpenGL on Mac OSX Mojave 10.14

    On my latest MacOS Mojave (10.14) laptop, using Python3.6 I'm trying to use OpenGL (using pyOpenGL), and I'm getting an error when trying to use some of the functions. e.g.

    from OpenGL.GL import *
    from OpenGL.GLU import *
    from OpenGL.GLUT import *

    glGenVertexArrays(1)
    glGenVertexArrays throws the following exception:

    OpenGL.error.NullFunctionError: Attempt to call an undefined function glGenVertexArrays, check for bool(glGenVertexArrays) before calling

    Under the hood, inside that function, there's a function called "baseplatform.py:checkExtension()" that receives "false" for trying to check the OpenGL extension: 'GL_ARB_vertex_array_object'

    This code works perfectly on a windows machine.

    some OpenGL functionality exists (some OpenGL functions are called before and don't raise errors). Anyone knows of a workaround? Maybe something to install\upgrade\downgrade?

    I'm aware that Apple announced that they will drop support for OpenGL in the future, but from I could find, it's not supposed to affect 10.14 yet.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,006
    Quote Originally Posted by yakirs View Post
    On my latest MacOS Mojave (10.14) laptop, using Python3.6 I'm trying to use OpenGL (using pyOpenGL), and I'm getting an error when trying to use some of the functions.
    Try
    Code :
    glutInitContextVersion(3, 2)
    glutInitContextProfile(GLUT_CORE_PROFILE)
    If that doesn't work, you're probably out of luck. MacOS doesn't support the OpenGL 3.2+ compatibility profile. You have to choose between OpenGL 2.1 or 3.2+ core profile. GLUT doesn't use the core profile unless specifically requested, because that will break code written for earlier versions of OpenGL. VAOs were added in 3.0, so using the default 2.1 context won't work.

    Note that glutInitContextVersion() and glutInitContextProfile() aren't present in the original GLUT library; they were added by FreeGLUT.

    Windows and Linux support the use of the compatibility profile, so the default context on those platforms is a compatibility-profile context for the highest supported OpenGL version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •