Documentation ¶
Index ¶
- Constants
- func Init() error
- func PollEvents()
- func PostEmptyEvent()
- func SetMonitorCallback(cbfun func(monitor *Monitor, event PeripheralEvent))
- func SwapInterval(interval int)
- func Terminate()
- func UpdateGamepadMappings(mapping string) bool
- func WaitEvents()
- func WindowHint(target Hint, hint int)
- type Action
- type CharModsCallback
- type CloseCallback
- type Cursor
- type ErrorCode
- type FramebufferSizeCallback
- type GamepadAxis
- type GamepadButton
- type GamepadState
- type Hint
- type InputMode
- type Joystick
- type JoystickHatState
- type Key
- type ModifierKey
- type Monitor
- type MouseButton
- type PeripheralEvent
- type ScrollCallback
- type SizeCallback
- type StandardCursor
- type VidMode
- type Window
- func (w *Window) Destroy()
- func (w *Window) GetAttrib(attrib Hint) int
- func (w *Window) GetCursorPos() (x, y float64)
- func (w *Window) GetInputMode(mode InputMode) int
- func (w *Window) GetKey(key Key) Action
- func (w *Window) GetMonitor() *Monitor
- func (w *Window) GetMouseButton(button MouseButton) Action
- func (w *Window) GetPos() (x, y int)
- func (w *Window) GetSize() (width, height int)
- func (w *Window) Iconify()
- func (w *Window) MakeContextCurrent()
- func (w *Window) Maximize()
- func (w *Window) Restore()
- func (w *Window) SetAttrib(attrib Hint, value int)
- func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback)
- func (w *Window) SetCloseCallback(cbfun CloseCallback) (previous CloseCallback)
- func (w *Window) SetCursor(cursor *Cursor)
- func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback)
- func (w *Window) SetIcon(images []image.Image)
- func (w *Window) SetInputMode(mode InputMode, value int)
- func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int)
- func (w *Window) SetPos(xpos, ypos int)
- func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback)
- func (w *Window) SetShouldClose(value bool)
- func (w *Window) SetSize(width, height int)
- func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback)
- func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int)
- func (w *Window) SetTitle(title string)
- func (w *Window) ShouldClose() bool
- func (w *Window) Show()
- func (w *Window) SwapBuffers()
Constants ¶
View Source
const ( DontCare = -1 False = 0 True = 1 )
View Source
const ( Release = Action(0) Press = Action(1) Repeat = Action(2) )
View Source
const ( ModShift = ModifierKey(0x0001) ModControl = ModifierKey(0x0002) ModAlt = ModifierKey(0x0004) )
View Source
const ( MouseButtonLeft = MouseButton(0) MouseButtonRight = MouseButton(1) MouseButtonMiddle = MouseButton(2) )
View Source
const ( Joystick1 = Joystick(0) Joystick2 = Joystick(1) Joystick3 = Joystick(2) Joystick4 = Joystick(3) Joystick5 = Joystick(4) Joystick6 = Joystick(5) Joystick7 = Joystick(6) Joystick8 = Joystick(7) Joystick9 = Joystick(8) Joystick10 = Joystick(9) Joystick11 = Joystick(10) Joystick12 = Joystick(11) Joystick13 = Joystick(12) Joystick14 = Joystick(13) Joystick15 = Joystick(14) Joystick16 = Joystick(15) )
View Source
const ( ClientAPI = Hint(0x00022001) ContextVersionMajor = Hint(0x00022002) ContextVersionMinor = Hint(0x00022003) Decorated = Hint(0x00020005) Floating = Hint(0x00020007) Focused = Hint(0x00020001) FocusOnShow = Hint(0x0002000C) Iconified = Hint(0x00020002) Maximized = Hint(0x00020008) Resizable = Hint(0x00020003) TransparentFramebuffer = Hint(0x0002000A) Visible = Hint(0x00020004) )
View Source
const ( CursorMode = InputMode(0x00033001) StickyKeysMode = InputMode(0x00033002) StickyMouseButtonsMode = InputMode(0x00033003) )
View Source
const ( CursorDisabled = 0x00034003 CursorHidden = 0x00034002 CursorNormal = 0x00034001 NoAPI = 0 OpenGLAPI = 0x00030001 )
View Source
const ( NotInitialized = ErrorCode(0x00010001) NoCurrentContext = ErrorCode(0x00010002) InvalidEnum = ErrorCode(0x00010003) InvalidValue = ErrorCode(0x00010004) OutOfMemory = ErrorCode(0x00010005) PlatformError = ErrorCode(0x00010008) NoWindowContext = ErrorCode(0x0001000A) )
View Source
const ( ArrowCursor = StandardCursor(0x00036001) IBeamCursor = StandardCursor(0x00036002) CrosshairCursor = StandardCursor(0x00036003) HandCursor = StandardCursor(0x00036004) HResizeCursor = StandardCursor(0x00036005) VResizeCursor = StandardCursor(0x00036006) )
View Source
const ( HatCentered = JoystickHatState(0) HatUp = JoystickHatState(1) HatRight = JoystickHatState(2) HatDown = JoystickHatState(4) HatLeft = JoystickHatState(8) HatRightUp = HatRight | HatUp HatRightDown = HatRight | HatDown HatLeftUp = HatLeft | HatUp HatLeftDown = HatLeft | HatDown )
View Source
const ( AxisLeftX = GamepadAxis(0) AxisLeftY = GamepadAxis(1) AxisRightX = GamepadAxis(2) AxisRightY = GamepadAxis(3) AxisLeftTrigger = GamepadAxis(4) AxisRightTrigger = GamepadAxis(5) )
View Source
const ( ButtonA = GamepadButton(0) ButtonB = GamepadButton(1) ButtonX = GamepadButton(2) ButtonY = GamepadButton(3) ButtonLeftBumper = GamepadButton(4) ButtonRightBumper = GamepadButton(5) ButtonBack = GamepadButton(6) ButtonStart = GamepadButton(7) ButtonGuide = GamepadButton(8) ButtonLeftThumb = GamepadButton(9) ButtonRightThumb = GamepadButton(10) ButtonDpadUp = GamepadButton(11) ButtonDpadRight = GamepadButton(12) ButtonDpadDown = GamepadButton(13) ButtonDpadLeft = GamepadButton(14) )
View Source
const ( Key0 = Key(48) Key1 = Key(49) Key2 = Key(50) Key3 = Key(51) Key4 = Key(52) Key5 = Key(53) Key6 = Key(54) Key7 = Key(55) Key8 = Key(56) Key9 = Key(57) KeyA = Key(65) KeyApostrophe = Key(39) KeyB = Key(66) KeyBackslash = Key(92) KeyBackspace = Key(259) KeyC = Key(67) KeyCapsLock = Key(280) KeyComma = Key(44) KeyD = Key(68) KeyDelete = Key(261) KeyDown = Key(264) KeyE = Key(69) KeyEnd = Key(269) KeyEnter = Key(257) KeyEqual = Key(61) KeyEscape = Key(256) KeyF = Key(70) KeyF1 = Key(290) KeyF10 = Key(299) KeyF11 = Key(300) KeyF12 = Key(301) KeyF2 = Key(291) KeyF3 = Key(292) KeyF4 = Key(293) KeyF5 = Key(294) KeyF6 = Key(295) KeyF7 = Key(296) KeyF8 = Key(297) KeyF9 = Key(298) KeyG = Key(71) KeyGraveAccent = Key(96) KeyH = Key(72) KeyHome = Key(268) KeyI = Key(73) KeyInsert = Key(260) KeyJ = Key(74) KeyK = Key(75) KeyKP0 = Key(320) KeyKP1 = Key(321) KeyKP2 = Key(322) KeyKP3 = Key(323) KeyKP4 = Key(324) KeyKP5 = Key(325) KeyKP6 = Key(326) KeyKP7 = Key(327) KeyKP8 = Key(328) KeyKP9 = Key(329) KeyKPAdd = Key(334) KeyKPDecimal = Key(330) KeyKPDivide = Key(331) KeyKPEnter = Key(335) KeyKPEqual = Key(336) KeyKPMultiply = Key(332) KeyKPSubtract = Key(333) KeyL = Key(76) KeyLast = Key(348) KeyLeft = Key(263) KeyLeftAlt = Key(342) KeyLeftBracket = Key(91) KeyLeftControl = Key(341) KeyLeftShift = Key(340) KeyLeftSuper = Key(343) KeyM = Key(77) KeyMenu = Key(348) KeyMinus = Key(45) KeyN = Key(78) KeyNumLock = Key(282) KeyO = Key(79) KeyP = Key(80) KeyPageDown = Key(267) KeyPageUp = Key(266) KeyPause = Key(284) KeyPeriod = Key(46) KeyPrintScreen = Key(283) KeyQ = Key(81) KeyR = Key(82) KeyRight = Key(262) KeyRightAlt = Key(346) KeyRightBracket = Key(93) KeyRightControl = Key(345) KeyRightShift = Key(344) KeyRightSuper = Key(347) KeyS = Key(83) KeyScrollLock = Key(281) KeySemicolon = Key(59) KeySlash = Key(47) KeySpace = Key(32) KeyT = Key(84) KeyTab = Key(258) KeyU = Key(85) KeyUnknown = Key(-1) KeyUp = Key(265) KeyV = Key(86) KeyW = Key(87) KeyWorld1 = Key(161) KeyWorld2 = Key(162) KeyX = Key(88) KeyY = Key(89) KeyZ = Key(90) )
Variables ¶
This section is empty.
Functions ¶
func PollEvents ¶
func PollEvents()
func PostEmptyEvent ¶ added in v2.2.0
func PostEmptyEvent()
func SetMonitorCallback ¶
func SetMonitorCallback(cbfun func(monitor *Monitor, event PeripheralEvent))
func SwapInterval ¶
func SwapInterval(interval int)
func UpdateGamepadMappings ¶
func WaitEvents ¶ added in v2.2.0
func WaitEvents()
func WindowHint ¶
Types ¶
type CharModsCallback ¶
type CharModsCallback uintptr
func ToCharModsCallback ¶ added in v2.1.2
func ToCharModsCallback(cb func(window *Window, char rune, mods ModifierKey)) CharModsCallback
type CloseCallback ¶ added in v2.2.0
type CloseCallback uintptr
func ToCloseCallback ¶ added in v2.2.0
func ToCloseCallback(cb func(window *Window)) CloseCallback
type Cursor ¶ added in v2.1.0
type Cursor struct {
// contains filtered or unexported fields
}
func CreateStandardCursor ¶ added in v2.1.0
func CreateStandardCursor(shape StandardCursor) *Cursor
type FramebufferSizeCallback ¶
type FramebufferSizeCallback uintptr
func ToFramebufferSizeCallback ¶ added in v2.1.2
func ToFramebufferSizeCallback(cb func(window *Window, width int, height int)) FramebufferSizeCallback
type GamepadAxis ¶
type GamepadAxis int
type GamepadButton ¶
type GamepadButton int
type GamepadState ¶
type Joystick ¶
type Joystick int
func (Joystick) GetButtons ¶
func (Joystick) GetGamepadState ¶
func (j Joystick) GetGamepadState() *GamepadState
func (Joystick) GetHats ¶ added in v2.2.0
func (j Joystick) GetHats() []JoystickHatState
type JoystickHatState ¶ added in v2.2.0
type JoystickHatState int
type ModifierKey ¶
type ModifierKey int
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func GetMonitors ¶
func GetMonitors() []*Monitor
func GetPrimaryMonitor ¶
func GetPrimaryMonitor() *Monitor
func (*Monitor) GetContentScale ¶
func (*Monitor) GetVideoMode ¶
type MouseButton ¶
type MouseButton int
type PeripheralEvent ¶
type PeripheralEvent int
type ScrollCallback ¶
type ScrollCallback uintptr
func ToScrollCallback ¶ added in v2.1.2
func ToScrollCallback(cb func(window *Window, xoff float64, yoff float64)) ScrollCallback
type SizeCallback ¶
type SizeCallback uintptr
func ToSizeCallback ¶ added in v2.1.2
func ToSizeCallback(cb func(window *Window, width int, height int)) SizeCallback
type StandardCursor ¶ added in v2.1.0
type StandardCursor int
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func CreateWindow ¶
func (*Window) GetCursorPos ¶
func (*Window) GetInputMode ¶
func (*Window) GetMonitor ¶
func (*Window) GetMouseButton ¶
func (w *Window) GetMouseButton(button MouseButton) Action
func (*Window) MakeContextCurrent ¶
func (w *Window) MakeContextCurrent()
func (*Window) SetCharModsCallback ¶
func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback)
func (*Window) SetCloseCallback ¶ added in v2.2.0
func (w *Window) SetCloseCallback(cbfun CloseCallback) (previous CloseCallback)
func (*Window) SetFramebufferSizeCallback ¶
func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback)
func (*Window) SetInputMode ¶
func (*Window) SetMonitor ¶
func (*Window) SetScrollCallback ¶
func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback)
func (*Window) SetShouldClose ¶ added in v2.2.0
func (*Window) SetSizeCallback ¶
func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback)
func (*Window) SetSizeLimits ¶ added in v2.1.0
func (*Window) ShouldClose ¶
func (*Window) SwapBuffers ¶
func (w *Window) SwapBuffers()
Click to show internal directories.
Click to hide internal directories.