Palm-Studios / sh3redux

SILENT HILL 3 Engine Remake in OpenGL and C++
GNU General Public License v3.0
158 stars 15 forks source link

Added OpenGL error message debug callback #124

Closed Quaker762 closed 6 years ago

Quaker762 commented 6 years ago

Created a type definition for all OpenGL functions that are callback functions (__glCallback) as well as enabling OpenGL's debug callback routine (instead of us having to call glGetError constantly, which is deprecated at this point).

z33ky commented 6 years ago

Looks good, but running the tex-test results in [fatal] API (ERROR): GL_INVALID_ENUM error generated. Cannot enable <cap> in the current profile..

Quaker762 commented 6 years ago

This is due to #125. It should be all fixed.

z33ky commented 6 years ago

Oh yea, that. Makes sense :)

I wonder though if we should exit or just warn about it considering it "worked" before. I can't remember if I vocalized my thought before, but for prototyping I think it's a good idea to allow using unportable hacks without any friction.

Quaker762 commented 6 years ago

Oh yea, that. Makes sense :)

Dw the amount of times this tripped me up when I was testing....

I wonder though if we should exit or just warn about it considering it worked before.

It's a tad dirty, but perhaps a #ifdef DEBUG macro or something?? Or just log for debug and release builds?

z33ky commented 6 years ago

I've thought about it and I think we want to only log for any build. In release builds I think it's better to try and keep running with visual defects than outright aborting. In debug builds we don't really gain anything from aborting either. When we get a sort of HUD on the screen we should just write these warnings there. And we can eventually implement a test harness that also parses logs after execution.