class GL.GLView(Component, ViewBase)
The GLView class of the GL submodule provides an area
for displaying 3D graphics using OpenGL. It also provides model observation
and input handling facilities via the ViewBase
class.
Constructor
- GLView(double_buffer = True, alpha
= False,
- depth_buffer = True,
stencil_buffer = False,
- accum_buffer = False,
multisample = False)
- Creates a GLView having the specified characteristics. Note:
The double_buffer option is a hint only. If double buffering is not
available, a single-buffered view will be created instead.
Abstract methods
- init_context()
- Immediately after the view's OpenGL context is created, it is made
the current context and this method is called. You may use this method to
establish any desired initial OpenGL state.
- viewport_changed()
- This method is called after init_context() during creation
of the GLView, and again whenever the size of the view changes. When called,
the view's OpenGL context is the current context, and its viewport has been
set to (0, 0, w, h) where (w, h) is the new size
of the view. You may use this method to establish the desired projection.
- render()
- This method is called with the view's OpenGL context as the current
context whenever the view needs to be redrawn. On return, drawing will be
flushed and buffers swapped as appropriate.
Methods
- with_context(function)
- The function should be a callable object of no arguments.
Calls function with the view's OpenGL context as the current
context.
- invalidate()
- Marks the whole view as needing to be redrawn.
---