OpenGLContext.context

Abstract base class for all rendering contexts
OpenGL operates with the idea of a current context in which OpenGL calls will operate. This is something a little bit more than a "window", as it includes a number of (optional) off-screen buffers, and a great deal of state which is manipulated by the various OpenGL functions. (OpenGL is basically a huge state machine).
The Context in OpenGLContext is your basic interface to the context, and simple operation of OpenGLContext (such as that you'll see in most of the test scripts) can focus almost entirely on the Context object and its various customization points.
If you wish to use the scene graph facilities of OpenGLContext, look particularly at the abstract function getSceneGraph, which can be overridden to provide a particular scenegraph object to the renderer. SceneGraph objects provide their own light, background, and render-traversal mechanisms, which allow you to largely ignore the Context objects.
The bulk of the actual rendering work is done by the Visitor and RenderVisitor classes (or their shadow- enabled equivalents from shadow.passes), and it is these classes which define the rendering callbacks which are available from the Context class.

Functions

Classes

The Context object as a RenderNode
Returned as the child of the Context if there is no getSceneGraph() result.
Abstract base class on which all Rendering Contexts are based
The Context object represents a single rendering context for use by the application. This base class provides only the most rudimentary of application support, but sub-classes provide such things as navigation, and/or event handling.
Attributes:
sg
OpenGLContext.basenodes.sceneGraph; the root of the node-rendering tree. If not NULL, is used to control most aspects of the rendering process. See: getSceneGraph
renderPasses
callable object, normally an instance of OpenGLContext.passes.renderpass.PassSet which implements the rendering algorithm for the Context
alreadyDrawn
flag which is set/checked to determine whether the context needs to be redrawn, see: Context.triggerRedraw( ... ) Context.shouldRedraw( ... ) Context.suppressRedraw( ... ) for the API to use to interact with this attribute.
viewportDimensions
Storage for the current viewport dimensions, see: Context.Viewport( ... ) Context.getViewport( ... ) for the API used to interact with this attribute.
drawPollTimeout
default timeout for the drawPoll method
currentContext
class attribute pointing to the currently rendering Context instance. This allows code called during a Render-pass to access the Context object.
Note: wherever possible, use the passed render-pass's "context" attribute, rather than this class attribute. If that isn't possible, use the deprecated getCurrentContext function in this module.
allContexts
list of weak references to all instantiated Context objects, mostly of use for code which wants to refresh all contexts when shared resources/states are updated
drawing
flag set to indicate that this Context is currently drawing, mostly used internally
frameCounter
node, normally a framecounter.FrameCounter instance which is used to track frame rates, must have an addFrame method as seen in framecounter.FrameCounter, See setupFrameRateCounter
extensions
extensionmanager.ExtensionManager instance with which to find and initialise extensions for this context. See setupExtensionManager
cache
vrml.cache.Cache instance used for optimising the rendering of scenegraphs. See setupCache
redrawRequest
threading Event for triggering a request
scenegraphLock
threading Lock for blocking rendering from re-entering during a rendering pass
pickEvents
dictionary mapping event type and key to event object where each event requires select-render-pass support
contextDefinition
node describing the options used to create this context, passed in as "definition" argument on init, see OpenGLContext.contextdefinition.ContextDefinition for details.
coreProfile
set if the contextDefinition specifies that this is a core-profile-only context, that is, it does not support compatibility (legacy) entry points.