You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Dear IMGUI (and I believe some select stb libraries even have this), there is a concept that you're able to create contexts and pass them across dll boundaries. This enables hotcode reloading and is a huge productivity boost.
If you use bgfx code linked in as a hotloadable* dll, the globals here (https://github.com/bkaradzic/bgfx/blob/master/src/bgfx.cpp#L308) would be undefined(or set to 0 in debug mode), rendering them unusable for hotloading. The way to fix this is that we put all the globals into a single context and allow set/getBgfxContext.
This might disrupt some initialization code, but I believe the benefits outweight the costs.
PS. Note that this is NOT the same as building bgfx as a dll and using it wholesale: #551
Edit: Kind of got this working; here's a sample of the globals you'd need to fix up to use a single (super)context
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In Dear IMGUI (and I believe some select stb libraries even have this), there is a concept that you're able to create contexts and pass them across dll boundaries. This enables hotcode reloading and is a huge productivity boost.
See:
https://github.com/ocornut/imgui/blob/37a07858a913be5b4e932fcb38857566f24ff47a/imgui.h#L280
https://github.com/ocornut/imgui/blob/37a07858a913be5b4e932fcb38857566f24ff47a/imgui.cpp#L3692
If you use bgfx code linked in as a hotloadable* dll, the globals here (https://github.com/bkaradzic/bgfx/blob/master/src/bgfx.cpp#L308) would be undefined(or set to 0 in debug mode), rendering them unusable for hotloading. The way to fix this is that we put all the globals into a single context and allow set/getBgfxContext.
This might disrupt some initialization code, but I believe the benefits outweight the costs.
PS. Note that this is NOT the same as building bgfx as a dll and using it wholesale:
#551
Edit: Kind of got this working; here's a sample of the globals you'd need to fix up to use a single (super)context
Beta Was this translation helpful? Give feedback.
All reactions