Skip to content

ImGuiRenderer Class

C#
public class ImGuiRenderer

Inheritance object

When true, indicates thats the ImGui input system is going to use the mouse, for example when the mouse is over a UI element; otherwise false.

C#
public bool WantsMouseCapture { get; }

When true, indicates thats the ImGui input system is going to use the mouse, for example when focus is on a textbox; otherwise false.

C#
public bool WantsKeyboardCapture { get; }

When true, indicates thats the UI should be hidden and stopped. Once it’s hidden and stopped, this property is set to false.

C#
public bool HideRequested { get; set; }

Creates a texture and loads the font data from ImGui. Should be called when the Microsoft.Xna.Framework.Graphics.GraphicsDevice is initialized but before any rendering is done

C#
public virtual void RebuildFontAtlas()

Creates a pointer to a texture, which can be passed through ImGui calls such as Image(ImTextureID, Vector2, Vector2, Vector2, Vector4, Vector4). That pointer is then used by ImGui to let us know what texture to draw

C#
public virtual ImTextureID BindTexture(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D

Hexa.NET.ImGui.ImTextureID

Removes a previously created texture pointer, releasing its reference and allowing it to be deallocated

C#
public virtual void UnbindTexture(ImTextureID textureId)

textureId Hexa.NET.ImGui.ImTextureID

Removes a previously created texture pointer, releasing its reference and allowing it to be deallocated

C#
public virtual void UnbindTexture(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D

Runs the ImGui input. Call before BeforeLayout(GameTime).

C#
public void BeforeLayoutInput(GameTime gameTime)

gameTime Microsoft.Xna.Framework.GameTime
Game frame delta.

Sets up ImGui for a new frame, should be called at frame start

C#
public virtual void BeforeLayout(GameTime gameTime)

gameTime Microsoft.Xna.Framework.GameTime

Asks ImGui for the generated geometry data and sends it to the graphics pipeline, should be called after the UI is drawn using ImGui.** calls

C#
public virtual void AfterLayout()

Setup key input event handler.

C#
protected virtual void SetupInput()

Updates the Microsoft.Xna.Framework.Graphics.Effect to the current matrices and texture

C#
protected virtual Effect UpdateEffect(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D

Microsoft.Xna.Framework.Graphics.Effect

Sends XNA input state to ImGui

C#
protected virtual void UpdateInput()
C#
public ImFontPtr AddFontTTF(string file, float size)

file string

size float

Hexa.NET.ImGui.ImFontPtr

C#
public void SetDefaultFont(ImFontPtr value)

value Hexa.NET.ImGui.ImFontPtr

C#
public bool HasBoundTexture(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D

bool

C#
public ImTextureID GetBoundTexturePointer(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D

Hexa.NET.ImGui.ImTextureID

ReplaceBoundTexture(ImTextureID, Texture2D)

Section titled “ReplaceBoundTexture(ImTextureID, Texture2D)”
C#
public void ReplaceBoundTexture(ImTextureID textureID, Texture2D texture)

textureID Hexa.NET.ImGui.ImTextureID

texture Microsoft.Xna.Framework.Graphics.Texture2D