Haiku’s FAQ

How to use the OpenGL 3.3 backend ?

If you need the OpenGL 3.3 backend (required on MAC OS), you just have to enable the HAIKU_BUILD_GL33 option during the cmake configuration:

# In the build directory, we need to configure the project with the HAIKU_BUILD_SAMPLES option
$> cmake .. -D HAIKU_BUILD_GL33:BOOL=ON
# Now we can build the project:
$> cmake --build . --config [Debug or Release]

How to test if an extension is available (at runtime, OpenGL 4.6) ?

If you need to use a specific extension in your program, Haiku ships a generated GLAD header with all OpenGL extensions. It may be wise to test if the extension is available on your hardware. You can use the global variables of GLAD to test is the extension was successfully loaded:

/* In IApplication::Create() */
if(!GLAD_GL_NV_shader_atomic_int64)
    Message::Warning("GL_NV_shader_atomic_int64 is not supported on your platform.");

If this extension is optional at the execution of your program, it will probably be necessary to disable the automatic reloading of shader (on failure).

ShaderStage::CreateFromFile(&m_vs_simple, GL_VERTEX_SHADER, vert_shader_source);
ShaderStage::CreateFromFile(&m_fs_simple, GL_FRAGMENT_SHADER, frag_shader_source, false);
Pipeline::Create(&m_pp_simple, m_vs_simple, m_fs_simple);

Why make your own math library instead of using existing, well-established libraries (glm, linmath, eigen, etc.) ?

To learn. In addition, it supports swizzling ! And you can use any other math library with Haiku.