66 Fast3dGui(std::vector<std::shared_ptr<Ship::GuiWindow>> guiWindows);
92 void LoadGuiTexture(
const std::string& name,
const std::string& path,
const ImVec4& tint);
166 std::shared_ptr<Ship::ConsoleVariable>
168 std::shared_ptr<Ship::ResourceManager>
173 void ApplyResolutionChanges();
179 int16_t GetIntegerScaleFactor();
181 std::unordered_map<std::string, Ship::GuiTextureMetadata> mGuiTextures;
Concrete Gui subclass for the Fast3D rendering backend.
Definition Fast3dGui.h:63
void Init(GuiWindowInitData windowImpl)
Initialises the ImGui context with the given backend-specific handles.
void UnloadTexture(const std::string &name)
Removes the texture with the given name from the cache and frees GPU resources.
void DrawGame() override
Renders the game viewport inside the main docking space. The base implementation is a no-op....
void ImGuiBackendInit() override
Initialises the renderer ImGui backend (DX11 / OpenGL / Metal). The base implementation is a no-op.
void LoadGuiTexture(const std::string &name, const Fast::Texture &tex, const ImVec4 &tint)
Uploads a Fast::Texture object to the GPU and caches it under name.
GuiWindowInitData mImpl
Backend-specific window/context handles passed to Init().
Definition Fast3dGui.h:164
void DrawFloatingWindows() override
Draws all registered floating GuiWindow instances. The base implementation is a no-op....
void CalculateGameViewport() override
Recalculates the game viewport rect to account for the menu bar and window size. The base implementat...
void ImGuiBackendShutdown() override
Shuts down the renderer ImGui backend. The base implementation is a no-op.
void LoadTextureFromResource(const std::string &name, std::shared_ptr< Ship::GuiTexture > texture)
Uploads a pre-loaded GuiTexture resource to the GPU and caches it.
void ImGuiBackendNewFrame() override
Calls the appropriate ImGui backend New Frame function (DX11 / GL / Metal). The base implementation i...
~Fast3dGui() override=default
void ImGuiWMShutdown() override
Shuts down the platform/window-manager ImGui backend. The base implementation is a no-op.
void LoadGuiTexture(const std::string &name, const std::string &path, const ImVec4 &tint)
Loads an image from an archive path and caches it under the given name.
bool SupportsViewports() override
Returns true if the ImGui multi-viewport / docking feature is supported by the current backend.
Fast3dGui(std::vector< std::shared_ptr< Ship::GuiWindow > > guiWindows)
std::shared_ptr< Ship::ResourceManager > mResourceManager
Cached ResourceManager component.
Definition Fast3dGui.h:169
std::weak_ptr< Interpreter > mInterpreter
Weak reference to the Fast3D scripting interpreter.
Definition Fast3dGui.h:163
ImVec2 GetTextureSize(const std::string &name)
Returns the pixel dimensions of the cached texture.
void ImGuiRenderDrawData(ImDrawData *data) override
Submits the ImGui draw data to the active graphics backend. The base implementation is a no-op.
std::shared_ptr< Ship::Window > mWindow
Cached Window component.
Definition Fast3dGui.h:165
void HandleWindowEvents(Fast::WindowEvent event)
Forwards a platform window event to the active ImGui backend.
ImTextureID GetTextureByName(const std::string &name)
Returns the ImGui texture handle for the given cache key.
void ImGuiWMNewFrame() override
Calls ImGui_ImplSDL2_NewFrame() or the platform equivalent. The base implementation is a no-op.
ImTextureID GetTextureById(int32_t id)
Returns the ImTextureID for a texture identified by its integer ID.
std::shared_ptr< Ship::ConsoleVariable > mConsoleVariables
Cached ConsoleVariable component.
Definition Fast3dGui.h:167
void ImGuiWMInit() override
Initialises the platform/window-manager ImGui backend. The base implementation is a no-op.
void RefreshImGuiGamepads() override
Re-binds the ImGui platform backend's gamepad list to the currently connected controllers....
void LoadTextureFromRawImage(const std::string &name, const std::string &path)
Loads a raw image file from the filesystem (not the archive) and caches it.
bool HasTextureByName(const std::string &name)
Returns true if a texture with the given name is already cached.
Owns and drives the ImGui context, all registered GuiWindows, and texture management.
Definition Gui.h:40
Definition gfx_direct3d_common.h:19
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
Backend-specific data required to initialise the ImGui rendering context.
Definition Fast3dGui.h:31
SDL_Renderer * Renderer
SDL_Renderer* (for Metal layer)
Definition Fast3dGui.h:44
uint32_t Width
Framebuffer width in pixels.
Definition Fast3dGui.h:47
void * Device
ID3D11Device*.
Definition Fast3dGui.h:36
void * Window
HWND.
Definition Fast3dGui.h:34
uint32_t Height
Framebuffer height in pixels.
Definition Fast3dGui.h:48
void * Context
SDL_GLContext.
Definition Fast3dGui.h:40
void * DeviceContext
ID3D11DeviceContext*.
Definition Fast3dGui.h:35
Platform-agnostic wrapper around a window system event.
Definition WindowEvent.h:17