I am writing a program using an API that needs to get an OpenGL low-level context, but I am unable to understand when does the function CGLGetCurrentContext should return a value (an integer representing the context), and when it shouldn't.
Right now, the function CGLGetCurrentContext() is returning NULL, and this is breaking my program. How can I fix this?
What is the purpose of this function? How are OpenGL contexts modeled?