ultraq / redhorizon

Recreating the original 2D Command & Conquer games
Apache License 2.0
6 stars 4 forks source link

Better OpenGL debugging #43

Closed ultraq closed 3 years ago

ultraq commented 3 years ago

While I've sort of shoved error-checking under the rug with the checkForError call, constantly looking up whether the error flag has been set is annoying and the "old" method of error handling. Newer articles talk about enabling OpenGL debugging modes and assigning callbacks to be notified of errors, which is waaaay nicer.

From my brief look into it however, it's not something that would be present on my Mac as it's core in 4.3 and Mac OpenGL support sort of died at 4.1 (https://support.apple.com/en-us/HT202823). Are there any ways for me to use a more modern debugging scheme while still on older OpenGL versions? I previously used AspectJ for this kind of thing, so is that something that is worth getting working again?

ultraq commented 3 years ago

So I've got something which might work: for graphics hardware that supports the extension KHR_debug I enable the debug callback, otherwise you get nothing. So if I need to I'll add the necessary error checks here and there, but I really with Apple didn't dump all over their OpenGL support 😕