Documentation ¶
Overview ¶
Package glwidget provides a widget containing a GL ES framebuffer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GL ¶
GL is a widget that maintains an OpenGL ES context.
The Draw function is responsible for configuring the GL viewport and for publishing the result to the widget by calling the Publish method when the frame is complete. A typical draw function:
func(w *glwidget.GL) { w.Ctx.Viewport(0, 0, w.Rect.Dx(), w.Rect.Dy()) w.Ctx.ClearColor(0, 0, 0, 1) w.Ctx.Clear(gl.COLOR_BUFFER_BIT) // ... draw the frame w.Publish() }
The GL context is separate from the one used by the gldriver to render the window, and is only used by the glwidget package during initialization and for the duration of the Publish call. This means a glwidget user is free to use Ctx as a background GL context concurrently with the primary UI drawing done by the gldriver.