app

package
v0.0.0-...-63f7c67 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package app implements a cross-platform G3N app.

Index

Constants

View Source
const OnExit = "app.OnExit"

OnExit is the event generated by Application when the user tries to close the window (desktop) or the Exit() method is called.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	window.IWindow // Embedded GlfwWindow
	// contains filtered or unexported fields
}

Application

func App

func App(width, height int, title string) *Application

App returns the Application singleton, creating it the first time.

func (*Application) Exit

func (a *Application) Exit()

Exit requests to terminate the application Application will dispatch OnQuit events to registered subscribers which can cancel the process by calling CancelDispatch().

func (*Application) KeyState

func (a *Application) KeyState() *window.KeyState

KeyState returns the application's KeyState.

func (*Application) Renderer

func (a *Application) Renderer() *renderer.Renderer

Renderer returns the application's renderer.

func (*Application) Run

func (a *Application) Run(update func(rend *renderer.Renderer, deltaTime time.Duration))

Run starts the update loop. It calls the user-provided update function every frame.

func (*Application) RunTime

func (a *Application) RunTime() time.Duration

RunTime returns the elapsed duration since the call to Run().

Jump to

Keyboard shortcuts

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