env

package
v0.0.0-...-5c0810f Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

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

type KeyCallback func(key input.Key, modifier input.Modifier)

KeyCallback is called for pressing or releasing a key on the keyboard.

type ModifierCallback

type ModifierCallback func(modifier input.Modifier)

ModifierCallback is called when the currently active modifier changed.

type MouseButtonCallback

type MouseButtonCallback func(buttonMask uint32, modifier input.Modifier)

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

type MouseMoveCallback func(x float32, y float32)

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

type MouseScrollCallback func(dx float32, dy float32)

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

type ResizeCallback func(width int, height int)

ResizeCallback is called for a change of window dimensions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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