bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
https://bkaradzic.github.io/bgfx/overview.html
BSD 2-Clause "Simplified" License
15.05k stars 1.94k forks source link

Add a macro that allows not including STB's impl. #3318

Closed kalmard0 closed 1 month ago

kalmard0 commented 4 months ago

This is useful for projects that want to use bgfx's imgui layer but supply their own STB implementation that would otherwise conflict with this one (due to them being global C functions).

bkaradzic commented 4 months ago

I dislike this approach, but understand what's the problem...

Also bgfx doesn't use #ifdef/#ifndef rather uses defines that are set to 0 or 1.

kalmard0 commented 4 months ago

I dislike this approach, but understand what's the problem...

Also bgfx doesn't use #ifdef/#ifndef rather uses defines that are set to 0 or 1.

Any suggestions on how to implement this nicely?

bkaradzic commented 4 months ago

Any suggestions on how to implement this nicely?

Not really right now. I would have to look at it to refresh my memory why it's done like that.

kalmard0 commented 1 month ago

Let me know if you'd like to find a way to move forward with this or if I should close this PR.

bkaradzic commented 1 month ago

Somewhere in your setting add USE_LOCAL_STB=0:

https://github.com/bkaradzic/bgfx/commit/e4073f02597c3f7302852a81bf008ae6251768f4