Class ImGuiWindowing#

Class Documentation#

class ImGuiWindowing#

Interfacing class between ImGui and the TRAP::INTERNAL::WindowingAPI.

Remark

Headless mode: This class is not available in headless mode.

Public Static Functions

static bool Init(WindowingAPI::InternalWindow *window, bool installCallbacks, Graphics::RenderAPI renderAPI)#

Initialize the ImGui TRAP::INTERNAL::WindowingAPI interface.

Parameters:
  • window – Handle to the internal main window.

  • installCallbacks – Whether to set ImGui callbacks or not.

  • renderAPI – RenderAPI to be used by ImGui.

Returns:

True on successful initialization, false otherwise.

static void Shutdown()#

Shutdown the ImGui TRAP::INTERNAL::WindowingAPI interface.

static void NewFrame()#

Starts a new ImGui frame.

static void SetCustomCursor(WindowingAPI::InternalCursor *cursor)#

Set a custom cursor for ImGui.

Note

This will make ImGui the owner of the cursor!

Parameters:

cursor – Custom cursor to use.

static void SetCallbacksChainForAllWindows(bool chainForAllWindows)#

Set to true to enable chaining installed callbacks for all windows (including secondary viewports created y backends or by user).

Note

This is false by default meaning we only chain callbacks for the main viewport. We cannot set this to true by default because user callbacks code may not be testing the window parameter of their callback. If you set this to true your user callback code will need to make sure you are testing the window parameter.

Parameters:

chainForAllWindows – Whether to enable callback chaining or not.

static void InstallCallbacks(WindowingAPI::InternalWindow *window)#

Install ImGui callbacks.

Parameters:

windowWindow to set callbacks for.

static void RestoreCallbacks(WindowingAPI::InternalWindow *window)#

Restore old callbacks.

Parameters:

windowWindow to restore callbacks for.

static bool ShouldChainCallback(const WindowingAPI::InternalWindow *window)#

Check if the given window should chain callbacks.

Parameters:

windowWindow to check for chaining.

Returns:

True or false.