Documentation ¶
Index ¶
- type AbstractOpenGlWindow
- func (window *AbstractOpenGlWindow) OnCharCallback(callback CharCallback)
- func (window *AbstractOpenGlWindow) OnKey(callback KeyCallback)
- func (window *AbstractOpenGlWindow) OnModifier(callback ModifierCallback)
- func (window *AbstractOpenGlWindow) OnMouseButtonDown(callback MouseButtonCallback)
- func (window *AbstractOpenGlWindow) OnMouseButtonUp(callback MouseButtonCallback)
- func (window *AbstractOpenGlWindow) OnMouseMove(callback MouseMoveCallback)
- func (window *AbstractOpenGlWindow) OnMouseScroll(callback MouseScrollCallback)
- func (window *AbstractOpenGlWindow) OnRender(callback RenderCallback)
- func (window *AbstractOpenGlWindow) OnResize(callback ResizeCallback)
- func (window *AbstractOpenGlWindow) StickyKeyListener() input.StickyKeyListener
- type Application
- type CharCallback
- type KeyCallback
- type ModifierCallback
- type MouseButtonCallback
- type MouseMoveCallback
- type MouseScrollCallback
- type OpenGlWindow
- type RenderCallback
- type ResizeCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractOpenGlWindow ¶
type AbstractOpenGlWindow struct { CallRender RenderCallback CallResize ResizeCallback CallOnMouseMove MouseMoveCallback CallOnMouseButtonUp MouseButtonCallback CallOnMouseButtonDown MouseButtonCallback CallOnMouseScroll MouseScrollCallback CallModifier ModifierCallback CallKey KeyCallback CallCharCallback CharCallback // contains filtered or unexported fields }
AbstractOpenGlWindow implements the common, basic functionality of OpenGlWindow.
func InitAbstractOpenGlWindow ¶
func InitAbstractOpenGlWindow() AbstractOpenGlWindow
InitAbstractOpenGlWindow returns an initialized instance.
func (*AbstractOpenGlWindow) OnCharCallback ¶
func (window *AbstractOpenGlWindow) OnCharCallback(callback CharCallback)
OnCharCallback implements the OpenGlWindow interface
func (*AbstractOpenGlWindow) OnKey ¶
func (window *AbstractOpenGlWindow) OnKey(callback KeyCallback)
OnKey implements the OpenGlWindow interface
func (*AbstractOpenGlWindow) OnModifier ¶
func (window *AbstractOpenGlWindow) OnModifier(callback ModifierCallback)
OnModifier implements the OpenGlWindow interface
func (*AbstractOpenGlWindow) OnMouseButtonDown ¶
func (window *AbstractOpenGlWindow) OnMouseButtonDown(callback MouseButtonCallback)
OnMouseButtonDown implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) OnMouseButtonUp ¶
func (window *AbstractOpenGlWindow) OnMouseButtonUp(callback MouseButtonCallback)
OnMouseButtonUp implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) OnMouseMove ¶
func (window *AbstractOpenGlWindow) OnMouseMove(callback MouseMoveCallback)
OnMouseMove implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) OnMouseScroll ¶
func (window *AbstractOpenGlWindow) OnMouseScroll(callback MouseScrollCallback)
OnMouseScroll implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) OnRender ¶
func (window *AbstractOpenGlWindow) OnRender(callback RenderCallback)
OnRender implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) OnResize ¶
func (window *AbstractOpenGlWindow) OnResize(callback ResizeCallback)
OnResize implements the OpenGlWindow interface.
func (*AbstractOpenGlWindow) StickyKeyListener ¶
func (window *AbstractOpenGlWindow) StickyKeyListener() input.StickyKeyListener
StickyKeyListener returns an instance of a listener acting as an adapter for the key-down/-up callbacks.
type Application ¶
type Application interface { // Init sets up the application for the given OpenGL window. Init(window OpenGlWindow) }
Application represents the public interface between the environment and the actual application core.
type CharCallback ¶
type CharCallback func(char rune)
CharCallback is called for typing a character.
type KeyCallback ¶
KeyCallback is called for pressing or releasing a key on the keyboard.
type ModifierCallback ¶
ModifierCallback is called when the currently active modifier changed.
type MouseButtonCallback ¶
MouseButtonCallback is the function to receive button up/down events. An Up event is sent for every reported Down event, even if the mouse cursor is outside the client area.
type MouseMoveCallback ¶
MouseMoveCallback is the function to receive the current mouse coordinate while moving. Movement is reported while the cursor is within the client area of the window, and beyond the window as long as at least one captured button is pressed. Reported values are with sub-pixel precision, if possible.
type MouseScrollCallback ¶
MouseScrollCallback is the function to receive scroll events. Delta values are right-hand oriented: positive values go right/down/far.
type OpenGlWindow ¶
type OpenGlWindow interface { // OpenGl returns the OpenGL API wrapper for this window. OpenGl() opengl.OpenGl // OnRender registers a callback function which shall be called to update the scene. OnRender(callback RenderCallback) // OnResize registers a callback function for sizing events. OnResize(callback ResizeCallback) // Size returns the dimensions of the window display area in pixel. Size() (width int, height int) // SetFullScreen sets the full screen state of the window. SetFullScreen(on bool) // SetCursorVisible controls whether the mouse cursor is currently visible. SetCursorVisible(visible bool) // OnMouseMove registers a callback function for mouse move events. OnMouseMove(callback MouseMoveCallback) // OnMouseButtonDown registers a callback function for mouse button down events. OnMouseButtonDown(callback MouseButtonCallback) // OnMouseButtonUp registers a callback function for mouse button up events. OnMouseButtonUp(callback MouseButtonCallback) // OnMouseScroll registers a callback function for mouse scroll events. OnMouseScroll(callback MouseScrollCallback) // OnKey registers a callback function for key events. OnKey(callback KeyCallback) // OnModifier registers a callback function for change of modifier events. OnModifier(callback ModifierCallback) // OnCharCallback registers a callback function for typed characters. OnCharCallback(callback CharCallback) }
OpenGlWindow represents an OpenGL render surface.
type RenderCallback ¶
type RenderCallback func()
RenderCallback is the function to receive render events. When the callback returns, the window will swap the internal buffer.
type ResizeCallback ¶
ResizeCallback is called for a change of window dimensions.