app

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package app provides a GLFW+GL implementation of the github.com/mokiat/lacking/app package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config, controller app.Controller) error

Run starts a new application and opens a single window.

The specified configuration is used to determine how the window is initialized.

The specified controller will be used to send notifications on window state changes.

Types

type Config

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

Config represents an application window configuration.

func NewConfig

func NewConfig(title string, width, height int) *Config

NewConfig creates a new Config object that contains the minimum required settings.

func (*Config) Cursor

func (c *Config) Cursor() *app.CursorDefinition

Cursor returns the cursor configuration for this application.

func (*Config) CursorVisible

func (c *Config) CursorVisible() bool

CursorVisible returns whether the cursor will be shown when hovering over the window.

func (*Config) Fullscreen added in v0.10.0

func (c *Config) Fullscreen() bool

Fullscreen returns whether the window will be created in fullscreen mode.

func (*Config) Icon

func (c *Config) Icon() string

Icon returns the filepath location of an icon image that will be used by the application.

func (*Config) Locator added in v0.5.0

func (c *Config) Locator() resource.ReadLocator

Locator returns the resource locator that will be used to load app-specific resources (e.g. icon).

func (*Config) MaxSize

func (c *Config) MaxSize() (int, int)

MaxSize returns the maximum size for the window. This method returns (0, 0) if a maximum size is not specified.

func (*Config) Maximized

func (c *Config) Maximized() bool

Maximized returns whether the window will be created in maximized state.

func (*Config) MinSize

func (c *Config) MinSize() (int, int)

MinSize returns the minimum size for the window. This method returns (0, 0) if a minimum size is not specified.

func (*Config) SetCursor

func (c *Config) SetCursor(definition *app.CursorDefinition)

SetCursor configures a custom cursor to be used. Specifying nil disables the custom cursor.

func (*Config) SetCursorVisible

func (c *Config) SetCursorVisible(visible bool)

SetCursorVisible specifies whether the cursor should be displayed when moved over the window.

func (*Config) SetFullscreen added in v0.10.0

func (c *Config) SetFullscreen(fullscreen bool)

SetFullscreen specifies whether the window should be created in a fullscreen mode.

func (*Config) SetIcon

func (c *Config) SetIcon(icon string)

SetIcon specifies the filepath to an icon image that will be used for the application.

An empty string value indicates that no icon should be used.

func (*Config) SetLocator added in v0.5.0

func (c *Config) SetLocator(locator resource.ReadLocator)

SetLocator changes the resource locator that will be used to load app-specific resources (e.g. icon).

func (*Config) SetMaxSize

func (c *Config) SetMaxSize(width, height int)

SetMaxSize sets a maximum size for the window. Specifying a non-positive value for any dimension disables this setting.

func (*Config) SetMaximized

func (c *Config) SetMaximized(maximized bool)

SetMaximized specifies whether the window should be created in maximized state.

func (*Config) SetMinSize

func (c *Config) SetMinSize(width, height int)

SetMinSize sets a minimum size for the window. Specifying a non-positive value for any dimension disables this setting.

func (*Config) SetVSync

func (c *Config) SetVSync(vsync bool)

SetVSync indicates whether v-sync should be enabled.

func (*Config) VSync

func (c *Config) VSync() bool

VSync returns whether v-sync will be enabled.

type Gamepad added in v0.10.0

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

func (*Gamepad) ActionDownButton added in v0.10.0

func (g *Gamepad) ActionDownButton() bool

func (*Gamepad) ActionLeftButton added in v0.10.0

func (g *Gamepad) ActionLeftButton() bool

func (*Gamepad) ActionRightButton added in v0.10.0

func (g *Gamepad) ActionRightButton() bool

func (*Gamepad) ActionUpButton added in v0.10.0

func (g *Gamepad) ActionUpButton() bool

func (*Gamepad) BackButton added in v0.10.0

func (g *Gamepad) BackButton() bool

func (*Gamepad) Connected added in v0.10.0

func (g *Gamepad) Connected() bool

func (*Gamepad) DpadDownButton added in v0.10.0

func (g *Gamepad) DpadDownButton() bool

func (*Gamepad) DpadLeftButton added in v0.10.0

func (g *Gamepad) DpadLeftButton() bool

func (*Gamepad) DpadRightButton added in v0.10.0

func (g *Gamepad) DpadRightButton() bool

func (*Gamepad) DpadUpButton added in v0.10.0

func (g *Gamepad) DpadUpButton() bool

func (*Gamepad) ForwardButton added in v0.10.0

func (g *Gamepad) ForwardButton() bool

func (*Gamepad) LeftBumper added in v0.10.0

func (g *Gamepad) LeftBumper() bool

func (*Gamepad) LeftStickButton added in v0.10.0

func (g *Gamepad) LeftStickButton() bool

func (*Gamepad) LeftStickX added in v0.10.0

func (g *Gamepad) LeftStickX() float64

func (*Gamepad) LeftStickY added in v0.10.0

func (g *Gamepad) LeftStickY() float64

func (*Gamepad) LeftTrigger added in v0.10.0

func (g *Gamepad) LeftTrigger() float64

func (*Gamepad) Pulse added in v0.10.0

func (g *Gamepad) Pulse(intensity float64, duration time.Duration)

func (*Gamepad) RightBumper added in v0.10.0

func (g *Gamepad) RightBumper() bool

func (*Gamepad) RightStickButton added in v0.10.0

func (g *Gamepad) RightStickButton() bool

func (*Gamepad) RightStickX added in v0.10.0

func (g *Gamepad) RightStickX() float64

func (*Gamepad) RightStickY added in v0.10.0

func (g *Gamepad) RightStickY() float64

func (*Gamepad) RightTrigger added in v0.10.0

func (g *Gamepad) RightTrigger() float64

func (*Gamepad) SetStickDeadzone added in v0.10.0

func (g *Gamepad) SetStickDeadzone(deadzone float64)

func (*Gamepad) SetTriggerDeadzone added in v0.10.0

func (g *Gamepad) SetTriggerDeadzone(deadzone float64)

func (*Gamepad) StickDeadzone added in v0.10.0

func (g *Gamepad) StickDeadzone() float64

func (*Gamepad) Supported added in v0.10.0

func (g *Gamepad) Supported() bool

func (*Gamepad) TriggerDeadzone added in v0.10.0

func (g *Gamepad) TriggerDeadzone() float64

Jump to

Keyboard shortcuts

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