How to test for OpenGL?

An approach I’ve used is to:

  • Create a test component with 1x1 px size, positioned in the corner of the window. This component should hold an OpenGLContext.
  • Give the OpenGLContext a custom renderer. This renderer will simply check some of the context’s extension function pointers in the first paint callback, and then use MessageManager::callAsync to report back whether or not the context supports all the features that are required.
  • When the callback is fired, the owner of the test component can delete the test component, and then either create a real OpenGL context, or fall back to a software renderer.
2 Likes