Blue Engine ImGUI plugin
This is a plugin that adds ImGUI support to the Blue Engine.
Getting started
To get started, create a new struct that will contain your GUI code. For our example:
Then We'll implement the Gui trait of the plugin:
And finally your ImGUI code:
// Create a new imgui window to contain the UI
new.build;
A few more steps are left to be done to have the plugin working. First we need to initialize the plugin before update loop:
let gui_context = new;
This will essentially initializes the imgui and create things required to run the plugin. Next step is inside the update loop, we'll need to update the plugin with encoder so that it can create a renderpass for displaying the UI. Here we will pass our UI struct as well:
// Here we update the imgui context every frame
event_fetchers.update;
The
event_fetchersis the last component in second list in update loop: [ [ _, _, _ ] , [ _, _, _, event_fetcher ] ]
And finally, last step is to add the context too the list of event fetchers, so that it'll get access to all the events immediately and fetch all inputs.
Style Block
The guide will come soon, it's cool I promise!
Examples
Check the examples folder for potential UIs and as template for your new projects.
Dependency justification
blue_engine: Used obiously for exporting some components and struct declrations required to design the APIimgui-wgpu: Used to assist in applying ImGUI to wgpu graphics backend. Which is same graphics backend used in Blue Engine.imgui-winit-support: Support for Winit windowing. Which is same windowing system used in Blue Engine.imgui: The imgui itself, required to obtain components and declrations for api design.