engine: github.com/g3n/engine/app Index | Files

package app

import "github.com/g3n/engine/app"

Package app implements a cross-platform G3N app.

Index

Package Files

app-desktop.go app.go

Constants

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.

type Application Uses

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

Application

func App Uses

func App() *Application

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

func (*Application) Exit Uses

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 Uses

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

KeyState returns the application's KeyState.

func (*Application) Renderer Uses

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

Renderer returns the application's renderer.

func (*Application) Run Uses

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 Uses

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

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

Package app imports 7 packages (graph) and is imported by 1 packages. Updated 2019-09-30. Refresh now. Tools for package owners.