Documentation ¶
Overview ¶
Package app implements a cross-platform G3N app.
Index ¶
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.
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().