Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Window ¶
type Window struct { Window *sdl.Window WindowID uint32 GLContext sdl.GLContext Backend *goglbackend.GoGLBackend Event func(event sdl.Event) MouseDown func(button, x, y int) MouseMove func(x, y int) MouseUp func(button, x, y int) MouseWheel func(x, y int) KeyDown func(scancode int, rn rune, name string) KeyUp func(scancode int, rn rune, name string) KeyChar func(rn rune) SizeChange func(w, h int) // contains filtered or unexported fields }
Window represents the opened window with GL context. The Mouse* and Key* functions can be set for callbacks
func CreateWindow ¶
CreateWindow creates a window using SDL and initializes the OpenGL context
func (*Window) Destroy ¶
func (wnd *Window) Destroy()
Destroy destroys the GL context and the window
func (*Window) FinishFrame ¶
func (wnd *Window) FinishFrame()
FinishFrame updates the FPS count and displays the frame
func (*Window) FramebufferSize ¶
FramebufferSize returns the current width and height of the framebuffer, which is also the internal size of the canvas
func (*Window) MainLoop ¶
func (wnd *Window) MainLoop(run func())
MainLoop runs a main loop and calls run on every frame
func (*Window) Size ¶
Size returns the current width and height of the window. Note that this size may not be the same as the size of the framebuffer, since some operating systems scale the window. Use the Width/Height/Size function on Canvas to determine the drawing size
func (*Window) StartFrame ¶
StartFrame handles events and gets the window ready for rendering