Documentation ¶
Overview ¶
Package app implements a cross-platform G3N app.
Index ¶
- type Application
- func (w Application) CreateCursor(imgFile string, xhot, yhot int) (core.Cursor, error)
- func (w Application) Destroy()
- func (a *Application) Exit()
- func (w Application) FullScreen() bool
- func (w Application) GetScale() (x float64, y float64)
- func (w Application) Gls() *gls.GLS
- func (a *Application) OpenDefaultAudioDevice() error
- func (w Application) PollEvents()
- func (a *Application) Renderer() *renderer.Renderer
- func (a *Application) Run(update func(rend *renderer.Renderer, deltaTime time.Duration))
- func (a *Application) RunTime() time.Duration
- func (w Application) ScreenResolution() (width, height int)
- func (w Application) SetCursor(cursor core.Cursor)
- func (w Application) SetFullScreen(full bool)
- func (w Application) SetSwapInterval(interval int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is the main overall G3N container.
func NewApplication ¶ added in v0.2.18
func NewApplication(width, height int, title string) *Application
NewApplication creates a new Application.
func (Application) CreateCursor ¶ added in v0.2.18
CreateCursor creates a new custom cursor and returns an int handle.
func (Application) Destroy ¶ added in v0.2.18
func (w Application) Destroy()
Destroy destroys this window and its context
func (Application) FullScreen ¶ added in v0.2.18
func (w Application) FullScreen() bool
FullScreen returns whether this window is currently fullscreen.
func (Application) GetScale ¶ added in v0.2.18
GetScale returns this window's DPI scale factor (FramebufferSize / Size)
func (*Application) OpenDefaultAudioDevice ¶ added in v0.2.7
func (a *Application) OpenDefaultAudioDevice() error
OpenDefaultAudioDevice opens the default audio device setting it to the current context.
func (Application) PollEvents ¶ added in v0.2.18
func (w Application) PollEvents()
PollEvents process events in the event queue
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 and 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().
func (Application) ScreenResolution ¶ added in v0.2.18
func (w Application) ScreenResolution() (width, height int)
ScreenResolution returns the screen resolution
func (Application) SetFullScreen ¶ added in v0.2.18
func (w Application) SetFullScreen(full bool)
SetFullScreen sets this window as fullscreen on the primary monitor.
func (Application) SetSwapInterval ¶ added in v0.2.18
func (w Application) SetSwapInterval(interval int)
SetSwapInterval sets the number of screen updates to wait from the time SwapBuffer() is called before swapping the buffers and returning.