Timeline for How can I handle errors when there is no valid OpenGL context?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 25, 2013 at 16:04 | comment | added | user1430 | No, it is implementation-dependent, which is why these functions are in the OS-level implementations and not GL itself. | |
| Nov 25, 2013 at 14:04 | comment | added | Dan Halliday |
Ok thanks, that's what I featured looking through the header I found aglGetCurrentContext() in on OSX. It's hard to believe there's no function/macro in the OpenGL API to check current context. Surely, it's just a case of reading one thread-local variable!
|
|
| Nov 25, 2013 at 13:54 | comment | added | kolrabi | No you cannot safely assume that. Depending on what is used to create the context those functions might not even be present. If you don't have control over the context management you can't check the active context directly. But maybe you could make it mandatory for the user to provide a callback that returns whether or not a context is active. | |
| Nov 25, 2013 at 13:36 | comment | added | Dan Halliday | The problem with this is I don't have any control over the context creation/management. Could I assume that these functions will work however my users decide to create their context? | |
| Nov 25, 2013 at 13:26 | history | answered | kolrabi | CC BY-SA 3.0 |