imgui_wrapper

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: BSD-3-Clause, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package imgui_wrapper provides a basic framework for an IMGui app.

Index

Constants

This section is empty.

Variables

View Source
var FontMono *imgui.Font

Current monospace font.

Functions

func Main

func Main(title string, options Options) error

Types

type Options

type Options struct {
	// Initial window size.
	WindowSize imgui.Vec2
	// Minimum window size, or zero.
	WindowMinSize imgui.Vec2
	// Called once, after the initial
	// state is determined and before any
	// drawing takes place. May be nil.
	OnInitWindow func(state *State) error
	// Called to do various pre-frame setup.
	// If anything can err, it should happen
	// in here. No drawing should take place
	// in here. May be nil.
	OnPreDraw func(state *State) error
	// Should not return an error. Control
	// flow should be straight-forward and
	// always reach the end.
	OnDraw func(state *State)
	// Drag-and-drop drop callback, or nil.
	OnDrop func(paths []string)
	// Make the OpenGL context a debug context.
	GLDebugContext bool
}

type State

type State struct {
	// Target FPS, can be changed anytime seamlessly.
	FrameRate float64
	// GUI Scale and CJK fonts will need a bit of
	// time to load after changing to a different
	// value.
	GUIScale     float32
	LoadCJKFonts bool
	// contains filtered or unexported fields
}

State contains exported fields, which can be changed anytime by the callback functions to update certain settings.

Jump to

Keyboard shortcuts

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