Documentation ¶
Overview ¶
Package app provides a GLFW+GL implementation of the github.com/mokiat/lacking/app package.
Index ¶
- func Run(cfg *Config, controller app.Controller) error
- type Config
- func (c *Config) AudioEnabled() bool
- func (c *Config) Cursor() *app.CursorDefinition
- func (c *Config) CursorVisible() bool
- func (c *Config) Fullscreen() bool
- func (c *Config) Icon() string
- func (c *Config) Locator() resource.ReadLocator
- func (c *Config) MaxSize() (int, int)
- func (c *Config) Maximized() bool
- func (c *Config) MinSize() (int, int)
- func (c *Config) SetAudioEnabled(enabled bool)
- func (c *Config) SetCursor(definition *app.CursorDefinition)
- func (c *Config) SetCursorVisible(visible bool)
- func (c *Config) SetFullscreen(fullscreen bool)
- func (c *Config) SetIcon(icon string)
- func (c *Config) SetLocator(locator resource.ReadLocator)
- func (c *Config) SetMaxSize(width, height int)
- func (c *Config) SetMaximized(maximized bool)
- func (c *Config) SetMinSize(width, height int)
- func (c *Config) SetTitle(title string)
- func (c *Config) SetVSync(vsync bool)
- func (c *Config) Title() string
- func (c *Config) VSync() bool
- type Gamepad
- func (g *Gamepad) ActionDownButton() bool
- func (g *Gamepad) ActionLeftButton() bool
- func (g *Gamepad) ActionRightButton() bool
- func (g *Gamepad) ActionUpButton() bool
- func (g *Gamepad) BackButton() bool
- func (g *Gamepad) Connected() bool
- func (g *Gamepad) DpadDownButton() bool
- func (g *Gamepad) DpadLeftButton() bool
- func (g *Gamepad) DpadRightButton() bool
- func (g *Gamepad) DpadUpButton() bool
- func (g *Gamepad) ForwardButton() bool
- func (g *Gamepad) LeftBumper() bool
- func (g *Gamepad) LeftStickButton() bool
- func (g *Gamepad) LeftStickX() float64
- func (g *Gamepad) LeftStickY() float64
- func (g *Gamepad) LeftTrigger() float64
- func (g *Gamepad) Pulse(intensity float64, duration time.Duration)
- func (g *Gamepad) RightBumper() bool
- func (g *Gamepad) RightStickButton() bool
- func (g *Gamepad) RightStickX() float64
- func (g *Gamepad) RightStickY() float64
- func (g *Gamepad) RightTrigger() float64
- func (g *Gamepad) SetStickDeadzone(deadzone float64)
- func (g *Gamepad) SetTriggerDeadzone(deadzone float64)
- func (g *Gamepad) StickDeadzone() float64
- func (g *Gamepad) Supported() bool
- func (g *Gamepad) TriggerDeadzone() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents an application window configuration.
func (*Config) AudioEnabled ¶ added in v0.18.0
AudioEnabled returns whether audio will be enabled.
func (*Config) Cursor ¶
func (c *Config) Cursor() *app.CursorDefinition
Cursor returns the cursor configuration for this application.
func (*Config) CursorVisible ¶
CursorVisible returns whether the cursor will be shown when hovering over the window.
func (*Config) Fullscreen ¶
Fullscreen returns whether the window will be created in fullscreen mode.
func (*Config) Icon ¶
Icon returns the filepath location of an icon image that will be used by the application.
func (*Config) Locator ¶
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 ¶
MaxSize returns the maximum size for the window. This method returns (0, 0) if a maximum size is not specified.
func (*Config) MinSize ¶
MinSize returns the minimum size for the window. This method returns (0, 0) if a minimum size is not specified.
func (*Config) SetAudioEnabled ¶ added in v0.18.0
SetAudioEnabled specifies whether audio should be enabled.
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 ¶
SetCursorVisible specifies whether the cursor should be displayed when moved over the window.
func (*Config) SetFullscreen ¶
SetFullscreen specifies whether the window should be created in a fullscreen mode.
func (*Config) SetIcon ¶
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 ¶
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 ¶
SetMaxSize sets a maximum size for the window. Specifying a non-positive value for any dimension disables this setting.
func (*Config) SetMaximized ¶
SetMaximized specifies whether the window should be created in maximized state.
func (*Config) SetMinSize ¶
SetMinSize sets a minimum size for the window. Specifying a non-positive value for any dimension disables this setting.
type Gamepad ¶
type Gamepad struct {
// contains filtered or unexported fields
}