Versions in this module Expand all Collapse all v1 v1.0.1 Jun 29, 2023 Changes in this version + var LinearFilterShader = &Shader + var NearestFilterShader = &Shader + var RegularTermination = errors.New("regular termination") + func DumpImages(dir string) (string, error) + func GraphicsDriverForTesting() graphicsdriver.Graphics + func IsScreenClearedEveryFrame() bool + func IsScreenTransparentAvailable() bool + func KeyName(key Key) string + func SetFPSMode(fpsMode FPSModeType) + func SetPanicOnErrorOnReadingPixelsForTesting(value bool) + func SetScreenClearedEveryFrame(cleared bool) + type CursorMode int + const CursorModeCaptured + const CursorModeHidden + const CursorModeVisible + type CursorShape int + const CursorShapeCrosshair + const CursorShapeDefault + const CursorShapeEWResize + const CursorShapeNSResize + const CursorShapePointer + const CursorShapeText + type FPSModeType int + const FPSModeVsyncOffMaximum + const FPSModeVsyncOffMinimum + const FPSModeVsyncOn + func FPSMode() FPSModeType + type Game interface + DrawFinalScreen func(scale, offsetX, offsetY float64) + DrawOffscreen func() error + Layout func(outsideWidth, outsideHeight float64) (screenWidth, screenHeight float64) + NewOffscreenImage func(width, height int) *Image + NewScreenImage func(width, height int) *Image + Update func() error + UpdateInputState func(fn func(*InputState)) + type GraphicsLibrary int + const GraphicsLibraryAuto + const GraphicsLibraryDirectX + const GraphicsLibraryMetal + const GraphicsLibraryOpenGL + const GraphicsLibraryUnknown + func GetGraphicsLibrary() GraphicsLibrary + func (g GraphicsLibrary) String() string + type Image struct + func NewImage(width, height int, imageType atlas.ImageType) *Image + func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices []float32, indices []uint16, ...) + func (i *Image) DumpScreenshot(name string, blackbg bool) (string, error) + func (i *Image) Fill(r, g, b, a float32, region image.Rectangle) + func (i *Image) MarkDisposed() + func (i *Image) ReadPixels(pixels []byte, region image.Rectangle) + func (i *Image) WritePixels(pix []byte, region image.Rectangle) + type InputState struct + CursorX int + CursorY int + DroppedFiles fs.FS + KeyPressed [KeyMax + 1]bool + MouseButtonPressed [MouseButtonMax + 1]bool + Runes []rune + Touches []Touch + WheelX float64 + WheelY float64 + WindowBeingClosed bool + type Key int + const KeyA + const KeyAltLeft + const KeyAltRight + const KeyArrowDown + const KeyArrowLeft + const KeyArrowRight + const KeyArrowUp + const KeyB + const KeyBackquote + const KeyBackslash + const KeyBackspace + const KeyBracketLeft + const KeyBracketRight + const KeyC + const KeyCapsLock + const KeyComma + const KeyContextMenu + const KeyControlLeft + const KeyControlRight + const KeyD + const KeyDelete + const KeyDigit0 + const KeyDigit1 + const KeyDigit2 + const KeyDigit3 + const KeyDigit4 + const KeyDigit5 + const KeyDigit6 + const KeyDigit7 + const KeyDigit8 + const KeyDigit9 + const KeyE + const KeyEnd + const KeyEnter + const KeyEqual + const KeyEscape + const KeyF + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF2 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyG + const KeyH + const KeyHome + const KeyI + const KeyInsert + const KeyJ + const KeyK + const KeyL + const KeyM + const KeyMax + const KeyMetaLeft + const KeyMetaRight + const KeyMinus + const KeyN + const KeyNumLock + const KeyNumpad0 + const KeyNumpad1 + const KeyNumpad2 + const KeyNumpad3 + const KeyNumpad4 + const KeyNumpad5 + const KeyNumpad6 + const KeyNumpad7 + const KeyNumpad8 + const KeyNumpad9 + const KeyNumpadAdd + const KeyNumpadDecimal + const KeyNumpadDivide + const KeyNumpadEnter + const KeyNumpadEqual + const KeyNumpadMultiply + const KeyNumpadSubtract + const KeyO + const KeyP + const KeyPageDown + const KeyPageUp + const KeyPause + const KeyPeriod + const KeyPrintScreen + const KeyQ + const KeyQuote + const KeyR + const KeyReserved0 + const KeyReserved1 + const KeyReserved2 + const KeyReserved3 + const KeyS + const KeyScrollLock + const KeySemicolon + const KeyShiftLeft + const KeyShiftRight + const KeySlash + const KeySpace + const KeyT + const KeyTab + const KeyU + const KeyV + const KeyW + const KeyX + const KeyY + const KeyZ + func (k Key) String() string + type MouseButton int + const MouseButton0 + const MouseButton1 + const MouseButton2 + const MouseButton3 + const MouseButton4 + const MouseButtonMax + type RunOptions struct + GraphicsLibrary GraphicsLibrary + InitUnfocused bool + ScreenTransparent bool + SkipTaskbar bool + type Shader struct + func NewShader(ir *shaderir.Program) *Shader + func (s *Shader) AppendUniforms(dst []uint32, uniforms map[string]any) []uint32 + func (s *Shader) MarkDisposed() + type Touch struct + ID TouchID + X int + Y int + type TouchID int + type UserInterface struct + func Get() *UserInterface + func (u *UserInterface) CursorMode() CursorMode + func (u *UserInterface) CursorShape() CursorShape + func (u *UserInterface) DeviceScaleFactor() float64 + func (u *UserInterface) IsFocused() bool + func (u *UserInterface) IsFullscreen() bool + func (u *UserInterface) IsRunnableOnUnfocused() bool + func (u *UserInterface) Run(game Game, options *RunOptions) error + func (u *UserInterface) ScheduleFrame() + func (u *UserInterface) ScreenSizeInFullscreen() (int, int) + func (u *UserInterface) SetCursorMode(mode CursorMode) + func (u *UserInterface) SetCursorShape(shape CursorShape) + func (u *UserInterface) SetFPSMode(mode FPSModeType) + func (u *UserInterface) SetFullscreen(fullscreen bool) + func (u *UserInterface) SetRunnableOnUnfocused(runnableOnUnfocused bool) + func (u *UserInterface) Window() Window + type Window interface + IsClosingHandled func() bool + IsDecorated func() bool + IsFloating func() bool + IsMaximized func() bool + IsMinimized func() bool + Maximize func() + Minimize func() + Position func() (int, int) + ResizingMode func() WindowResizingMode + Restore func() + SetClosingHandled func(handled bool) + SetDecorated func(decorated bool) + SetFloating func(floating bool) + SetIcon func(iconImages []image.Image) + SetPosition func(x, y int) + SetResizingMode func(mode WindowResizingMode) + SetSize func(width, height int) + SetSizeLimits func(minw, minh, maxw, maxh int) + SetTitle func(title string) + Size func() (int, int) + SizeLimits func() (minw, minh, maxw, maxh int) + type WindowResizingMode int + const WindowResizingModeDisabled + const WindowResizingModeEnabled + const WindowResizingModeOnlyFullscreenEnabled