Availability: S60.
The glcanvas module provides a UI control, GLCanvas, for displaying OpenGL ES graphics. GLCanvas component is similar to the appuifw Canvas component that supports Symbian OS -level drawing.
Internally GLCanvas uses EGL for displaying the OpenGL ES graphics. EGL, as OpenGL ES, is a standard API defined by the Khronos Group (www.khronos.org). Specifically, GLCanvas uses an EGL window surface, which supports double-buffered rendering. It is possible to affect selection of the EGL config that is used to create the window surface; for details, see the documentation of the GLCanvas constructor.
GLCanvas instances also hold the OpenGL ES context object, which
together with the surface, are needed for rendering. When one wants to render
with a specific OpenGL ES context to a specific surface, they need to be
made current. This also applies to GLCanvas, which has the
makeCurrent
method for this purpose. Generally, calling
makeCurrent
has to be done only if multiple GLCanvas objects are
used in the same program, as each GLCanvas object is automatically made
current when it is created and it remains current until it is destroyed or
makeCurrent
of some other GLCanvas object is called.
redraw_callback, [event_callback=None, resize_callback=None, attributes=None]) |
drawNow
method.
Parameter attributes can be used to specify attributes used in EGL config
selection. It must be a Python dictionary where keys are EGL attribute names
(which are defined in the glcanvas module) and values are integers
defining the desired attribute values. Unless specified in attributes,
EGL_BUFFER_SIZE
is set to value based on the display mode of the window
owned by the underlying CCoeControl object and EGL_DEPTH_SIZE
is
set to 16. Attributes specified in attributes are given to
eglChooseConfig
. Refer to the EGL specification for a detailed list of
config attributes and explanation of how the selection of EGL configs works.
The new GLCanvas object will be made current when the constructor
returns so makeCurrent
does not have to be called before starting to use
OpenGL ES calls.
key_code, c [, ((x1, y1), (x2, y2))]) |
For different bind scenarios refer Canvas's bind method.
) |
eglSwapBuffers
to
render and display the OpenGL ES graphics.
) |
eglMakeCurrent
. Using makeCurrent
makes it possible to use several
GLCanvas objects in a single application: the receiver of the OpenGL ES
calls can be switched with makeCurrent
easily.
See About this document... for information on suggesting changes.