Skip to content
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

Closed
l0calh05t opened this issue Nov 20, 2016 · 6 comments
Closed

FR: Support runtime enable/disable of debugging #68

l0calh05t opened this issue Nov 20, 2016 · 6 comments

Comments

@l0calh05t
Copy link

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 as gladEnableDebugging and gladDisableDebugging 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.

@Dav1dde
Copy link
Owner

Dav1dde commented Nov 20, 2016

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).

@l0calh05t
Copy link
Author

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.

@l0calh05t
Copy link
Author

This also allows on-demand debugging without the overhead and without rebuilding

@Dav1dde
Copy link
Owner

Dav1dde commented Nov 20, 2016

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.

@Person27
Copy link

Any updates on this?

@Dav1dde
Copy link
Owner

Dav1dde commented Jul 6, 2019

3 Years later, this is implemented in glad2 now through the functions gladInstall{API}Debug and gladUninstall{API}Debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants