debugui

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package debugui provides immediate-mode GUI integration for ECS applications using Dear ImGui. It manages ImGui rendering and input state through ECS components and systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDebugUIComponents

func RegisterDebugUIComponents(registry *ecs.ComponentRegistry)

func SpawnDebugUI

func SpawnDebugUI(storage *ecs.Storage)

Types

type ArchetypeInfo

type ArchetypeInfo struct {
	ID             uint32
	ComponentTypes []string
	EntityCount    int
	ComponentCount int
}

type ArchetypeViewerCache

type ArchetypeViewerCache struct {
	// contains filtered or unexported fields
}

type ArchetypeViewerComponent

type ArchetypeViewerComponent struct {
	// contains filtered or unexported fields
}

func NewArchetypeViewerComponent

func NewArchetypeViewerComponent() ArchetypeViewerComponent

func (*ArchetypeViewerComponent) Render

func (av *ArchetypeViewerComponent) Render(storage *ecs.Storage) *uint32

type ComponentInspectorComponent

type ComponentInspectorComponent struct {
	// contains filtered or unexported fields
}

func NewComponentInspectorComponent

func NewComponentInspectorComponent() ComponentInspectorComponent

func (*ComponentInspectorComponent) Render

func (ci *ComponentInspectorComponent) Render(storage *ecs.Storage, selectedEntityId ecs.EntityId)

type EntityBrowserCache

type EntityBrowserCache struct {
	// contains filtered or unexported fields
}

type EntityBrowserComponent

type EntityBrowserComponent struct {
	// contains filtered or unexported fields
}

func NewEntityBrowserComponent

func NewEntityBrowserComponent(maxEntitiesPerPage int) EntityBrowserComponent

func (*EntityBrowserComponent) GetSelectedEntity

func (eb *EntityBrowserComponent) GetSelectedEntity() ecs.EntityId

func (*EntityBrowserComponent) Render

func (eb *EntityBrowserComponent) Render(storage *ecs.Storage)

type EntityInfo

type EntityInfo struct {
	ID             ecs.EntityId
	ArchetypeID    uint32
	ComponentTypes []string
	ComponentCount int
}

type FieldInfo

type FieldInfo struct {
	Name      string
	Type      reflect.Type
	Index     int
	IsPointer bool
	IsStruct  bool
	IsSlice   bool
	IsMap     bool
}

type FrameTimer

type FrameTimer struct {
	// contains filtered or unexported fields
}

func NewFrameTimer

func NewFrameTimer() *FrameTimer

func (*FrameTimer) GetDeltaTime

func (ft *FrameTimer) GetDeltaTime() float32

type ImguiInputState

type ImguiInputState struct {
	WantCaptureMouse    bool
	WantCaptureKeyboard bool
}

ImguiInputState tracks Dear ImGui's input capture state as a singleton component. Use this to determine if ImGui is consuming mouse or keyboard input.

type ImguiItem

type ImguiItem struct {
	Render func()
}

ImguiItem is a component that holds a Dear ImGui render function. Attach this to entities that should render ImGui widgets each frame.

type ImguiSystem

type ImguiSystem struct {
	Items               ecs.Query[struct{ *ImguiItem }]
	InputState          ecs.Singleton[ImguiInputState]
	EntityBrowsers      ecs.Query[struct{ *EntityBrowserComponent }]
	ComponentInspectors ecs.Query[struct{ *ComponentInspectorComponent }]
	ArchetypeViewers    ecs.Query[struct{ *ArchetypeViewerComponent }]
	PerformanceStats    ecs.Query[struct{ *PerformanceStatsComponent }]
	QueryDebuggers      ecs.Query[struct{ *QueryDebuggerComponent }]
	FrameTimer          ecs.Singleton[FrameTimer]
}

ImguiSystem queries all ImguiItem components and defers their render functions. It also updates the ImguiInputState singleton with current input capture state.

func (*ImguiSystem) Execute

func (i *ImguiSystem) Execute(frame *ecs.UpdateFrame)

Execute updates input state and queues all ImGui render functions for execution.

type PerformanceStatsComponent

type PerformanceStatsComponent struct {
	// contains filtered or unexported fields
}

func NewPerformanceStatsComponent

func NewPerformanceStatsComponent(historyFrames int) PerformanceStatsComponent

func (*PerformanceStatsComponent) Render

func (ps *PerformanceStatsComponent) Render(storage *ecs.Storage, deltaTime float32)

type QueryDebuggerCache

type QueryDebuggerCache struct {
	// contains filtered or unexported fields
}

type QueryDebuggerComponent

type QueryDebuggerComponent struct {
	// contains filtered or unexported fields
}

func NewQueryDebuggerComponent

func NewQueryDebuggerComponent() QueryDebuggerComponent

func (*QueryDebuggerComponent) Render

func (qd *QueryDebuggerComponent) Render(storage *ecs.Storage)

type ReflectionCache

type ReflectionCache struct {
	// contains filtered or unexported fields
}

func NewReflectionCache

func NewReflectionCache() *ReflectionCache

func (*ReflectionCache) GetFields

func (rc *ReflectionCache) GetFields(t reflect.Type) []FieldInfo

Directories

Path Synopsis
Package ebiten provides Dear ImGui backend integration for the Ebiten game engine.
Package ebiten provides Dear ImGui backend integration for the Ebiten game engine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL