Documentation ¶
Index ¶
- func StepSliderInt(label string, value *int, min, max int) bool
- func StepSliderIntV(label string, value *int, min, max int, format string) bool
- func TextureIDForSimpleTexture(handle uint32) imgui.TextureID
- type BitmapTextureQuery
- type Context
- func (context *Context) Destroy()
- func (context Context) IsUsingKeyboard() bool
- func (context Context) IsUsingMouse() bool
- func (context *Context) MouseButtonChanged(buttonIndex int, down bool)
- func (context *Context) MouseScroll(dx, dy float32)
- func (context *Context) NewFrame()
- func (context *Context) Render(bitmapTextureQuery BitmapTextureQuery)
- func (context *Context) SetMousePosition(x, y float32)
- type ContextParameters
- type ImageType
- type ModalState
- type ModalStateMachine
- type ModalStateWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StepSliderInt ¶ added in v0.3.0
StepSliderInt calls StepSliderIntV(label, value, min, max, "%d")
func StepSliderIntV ¶ added in v0.3.0
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
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
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
IsUsingMouse returns true if the UI is using the mouse. The application should not process mouse events in this case.
func (*Context) MouseButtonChanged ¶
MouseButtonChanged is called when the state of a button has changed.
func (*Context) MouseScroll ¶
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 ¶
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.
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.