-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Support runtime enable/disable of debugging #68
Comments
You can set the callbacks to empty functions to "disable" debugging and set them back if you want to enable it again. For a release build you shouldn't use a debug build anyways (if the two additional calls are too expensive for you). |
As stated in the OP, I already know how to disable/enable debugging for individual functions. However, doing that for all functions (the set of which varies depending on GLAD settings!) is not practical without generating the corresponding code. |
This also allows on-demand debugging without the overhead and without rebuilding |
Setting the callback function to a no-op basically disables the debugging, you still have the indirection (and 2 additional function calls), but that's not really relevant because you shouldn't be using the debug build of glad for a release anyways. I just don't see enough value to generate these functions. I will keep it in the back of my head and maybe make it an option in the glad rework. |
Any updates on this? |
3 Years later, this is implemented in glad2 now through the functions |
Currently, we can explicitly disable debugging for individual functions by doing, e.g.,
glad_debug_glClear = glad_glClear;
. It would be nice if glad defined a pair of functions such asgladEnableDebugging
andgladDisableDebugging
which do this for all functions (enable obviously resetting the function pointers to their original values with callback). That way we could enable/disable debugging on demand at runtime and not only at compile time.The text was updated successfully, but these errors were encountered: