gui

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StepSliderInt added in v0.3.0

func StepSliderInt(label string, value *int, min, max int) bool

StepSliderInt calls StepSliderIntV(label, value, min, max, "%d")

func StepSliderIntV added in v0.3.0

func StepSliderIntV(label string, value *int, min, max int, format string) bool

StepSliderIntV creates a SliderInt with additional buttons to make single digit steps. min and max parameters are inclusive. Returns true on change.

func TextureIDForSimpleTexture added in v0.3.0

func TextureIDForSimpleTexture(handle uint32) imgui.TextureID

TextureIDForSimpleTexture returns a TextureID with ImageTypeSimpleTexture.

Types

type BitmapTextureQuery added in v0.3.0

type BitmapTextureQuery func(id imgui.TextureID) (palette uint32, texture uint32)

BitmapTextureQuery resolves the texture and the palette to be used for a bitmap.

type Context

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

Context describes a scope for a graphical user interface. It is based on ImGui.

func NewContext

func NewContext(window opengl.Window, param ContextParameters) (context *Context, err error)

NewContext initializes a new UI context based on the provided OpenGL window.

func (*Context) Destroy

func (context *Context) Destroy()

Destroy cleans up the resources of the graphical user interface.

func (Context) IsUsingKeyboard added in v1.1.0

func (context Context) IsUsingKeyboard() bool

IsUsingKeyboard returns true if the UI is currently capturing keyboard input. The application should not process keyboard input events in this case.

func (Context) IsUsingMouse added in v0.3.0

func (context Context) IsUsingMouse() bool

IsUsingMouse returns true if the UI is using the mouse. The application should not process mouse events in this case.

func (*Context) MouseButtonChanged

func (context *Context) MouseButtonChanged(buttonIndex int, down bool)

MouseButtonChanged is called when the state of a button has changed.

func (*Context) MouseScroll

func (context *Context) MouseScroll(dx, dy float32)

MouseScroll must be

func (*Context) NewFrame

func (context *Context) NewFrame()

NewFrame must be called at the start of rendering.

func (*Context) Render

func (context *Context) Render(bitmapTextureQuery BitmapTextureQuery)

Render must be called at the end of rendering.

func (*Context) SetMousePosition

func (context *Context) SetMousePosition(x, y float32)

SetMousePosition must be called to report the current mouse position.

type ContextParameters added in v0.3.0

type ContextParameters struct {
	// FontFile is the filename of a .TTF file to load instead of using default.
	FontFile string
	// FontSize is the requested size of the font. Defaults to 12.
	FontSize float32
}

ContextParameters describes how to create the context.

type ImageType added in v0.3.0

type ImageType byte

ImageType is an identifier how an image is to be rendered.

const (
	// ImageTypeSimpleTexture identifies textures that use the image key as OpenGL texture handle.
	ImageTypeSimpleTexture ImageType = 0
	// ImageTypeBitmapTexture identifies bitmap textures.
	ImageTypeBitmapTexture ImageType = 1
)

func ImageTypeFromID added in v0.3.0

func ImageTypeFromID(id imgui.TextureID) ImageType

ImageTypeFromID returns the image type the given texture ID specifies.

type ModalState added in v0.5.0

type ModalState interface {
	// Render renders the dialog.
	Render()
	// HandleFiles is called for any dropped files.
	HandleFiles(names []string)
}

ModalState represents a modal dialog

type ModalStateMachine added in v0.5.0

type ModalStateMachine interface {
	SetState(state ModalState)
}

ModalStateMachine allows to set a new state.

type ModalStateWrapper added in v0.5.0

type ModalStateWrapper struct {
	State ModalState
}

ModalStateWrapper is a wrapper over a series of modal popup states. It implements both ModalState and ModalStateMachine to allow nested states, if necessary.

func (*ModalStateWrapper) HandleFiles added in v0.5.0

func (machine *ModalStateWrapper) HandleFiles(filenames []string)

HandleFiles forwards the given filenames to the current state.

func (*ModalStateWrapper) Render added in v0.5.0

func (machine *ModalStateWrapper) Render()

Render renders the current state.

func (*ModalStateWrapper) SetState added in v0.5.0

func (machine *ModalStateWrapper) SetState(state ModalState)

SetState sets the new state.

Jump to

Keyboard shortcuts

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