glfwController

package
v0.0.0-...-e229e0e Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: GPL-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActionMap

func NewActionMap() controller.Controller

Types

type ActionMap

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

func (*ActionMap) BindAxisAction

func (am *ActionMap) BindAxisAction(function func(xpos, ypos float32))

func (*ActionMap) BindKeyAction

func (am *ActionMap) BindKeyAction(function func(), key controller.Key, action controller.Action)

Bindings

func (*ActionMap) BindMouseAction

func (am *ActionMap) BindMouseAction(function func(), button controller.MouseButton, action controller.Action)

func (*ActionMap) BindScrollAction

func (am *ActionMap) BindScrollAction(function func(xoffset, yoffset float32))

func (*ActionMap) CursorPosCallback

func (am *ActionMap) CursorPosCallback(window *glfw.Window, xpos, ypos float32)

func (*ActionMap) KeyCallback

func (am *ActionMap) KeyCallback(window *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)

Callbacks

func (*ActionMap) MouseButtonCallback

func (am *ActionMap) MouseButtonCallback(window *glfw.Window, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)

func (*ActionMap) ScrollCallback

func (am *ActionMap) ScrollCallback(window *glfw.Window, xoffset, yoffset float32)

func (*ActionMap) SetKeyAction

func (am *ActionMap) SetKeyAction(function func(key controller.Key, action controller.Action))

func (*ActionMap) SetMouseAction

func (am *ActionMap) SetMouseAction(function func(button controller.MouseButton, action controller.Action))

type Controller

type Controller interface {
	controller.Controller
	KeyCallback(window *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)
	MouseButtonCallback(window *glfw.Window, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)
	CursorPosCallback(window *glfw.Window, xpos, ypos float32)
	ScrollCallback(window *glfw.Window, xoffset, yoffset float32)
}

type ControllerManager

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

func NewControllerManager

func NewControllerManager(window *glfw.Window) *ControllerManager

func (*ControllerManager) AddController

func (c *ControllerManager) AddController(newCont Controller)

func (*ControllerManager) CursorPosCallback

func (c *ControllerManager) CursorPosCallback(window *glfw.Window, xpos, ypos float64)

Mouse movement callback

func (*ControllerManager) KeyCallback

func (c *ControllerManager) KeyCallback(window *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)

Key Callback

func (*ControllerManager) MouseButtonCallback

func (c *ControllerManager) MouseButtonCallback(window *glfw.Window, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)

Mouse click callback

func (*ControllerManager) RemoveController

func (c *ControllerManager) RemoveController(controller Controller)

func (*ControllerManager) ScrollCallback

func (c *ControllerManager) ScrollCallback(window *glfw.Window, xoffset, yoffset float64)

Mouse scrollwheel callback

type KeyAction

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

type MouseButtonAction

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

Jump to

Keyboard shortcuts

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