app

package
v0.2.66 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package app implements a cross-platform G3N app.

Index

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

func (w Application) CreateCursor(imgFile string, xhot, yhot int) (core.Cursor, error)

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) Exit

func (a *Application) Exit()

Exit requests to terminate the application.

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

func (w Application) GetScale() (x float64, y float64)

GetScale returns this window's DPI scale factor (FramebufferSize / Size)

func (Application) Gls added in v0.2.18

func (w Application) Gls() *gls.GLS

Gls returns the associated OpenGL state.

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) SetCursor added in v0.2.18

func (w Application) SetCursor(cursor core.Cursor)

SetCursor sets the window's cursor.

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.

Jump to

Keyboard shortcuts

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