Archon::Display::Bind Struct Reference

Establish a binding between the instantiating thread, a rendering context and a drawable such as a window. More...

#include <archon/display/context.H>

Collaboration diagram for Archon::Display::Bind:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Bind (const Ref< Context > &c, const Ref< Drawable > &d, bool block=true) throw (ContextAlreadyBoundException, NestedBindingException, invalid_argument)
 Performs an implicit call to 'aquire'.
 ~Bind ()
void aquire (const Ref< Context > &c, const Ref< Drawable > &d, bool block=true) throw (ContextAlreadyBoundException, NestedBindingException, invalid_argument)
 Attempt to establish a binding between the instantiating thread, the specified rendering context and the specified drawable.
void release ()
 Drop this binding.

Detailed Description

Establish a binding between the instantiating thread, a rendering context and a drawable such as a window.

The effect of such a binding is that OpenGL calls issued by the instantiating thread are executed within the bound rendering context causing polygons to be rendered on the bound drawable.

This binding is in effect as soon as the Bind variable is instantiated, and generally lasts as long as the Bind variable, which is until the end of the scope of that variable. Sometimes however it is usefull to be able to unbind and rebind withing a single valiable scope, which is possible with the 'release' and 'aquire' methods of this class.

A thread can only be bound to one rendering context and vice versa.

A drawable however can be bound to multiple rendering contexts, allowing multiple threads to render into the same drawable.

See also:
Context

Drawable

Window

Definition at line 129 of file context.H.


Constructor & Destructor Documentation

Archon::Display::Bind::Bind const Ref< Context > &  c,
const Ref< Drawable > &  d,
bool  block = true
throw (ContextAlreadyBoundException, NestedBindingException, invalid_argument) [inline]
 

Performs an implicit call to 'aquire'.

See also:
aquire.
Parameters:
c See 'aquire'.
d See 'aquire'.
block See 'aquire'.

Definition at line 142 of file context.H.

References aquire().


Member Function Documentation

void Archon::Display::Bind::aquire const Ref< Context > &  c,
const Ref< Drawable > &  d,
bool  block = true
throw (ContextAlreadyBoundException, NestedBindingException, invalid_argument) [inline]
 

Attempt to establish a binding between the instantiating thread, the specified rendering context and the specified drawable.

The context and the drawable must be based on the same visual.

If the specified context is currently bound to another thread the instantiation will by default block until the context becomes available. If you specify false for the 'block' argument the instantiation will fail in this case.

Parameters:
c The rendering context to bind.
d The drawable to bind. You may pass a window reference here.
block If true the instantiation will block until the specified context becomes available. Otherwise the instantiation will fail if the context is in use by another thread.
Exceptions:
ContextAlreadyBoundException If 'bound' argument was false and the specified context was in use by another thread.
NestedBindingException If the calling thread is already bound to a rendering context via a different Bind instance.
invalid_argument If the context and the drawable are based on different visuals.

Definition at line 181 of file context.H.

References release().

Referenced by Bind().


The documentation for this struct was generated from the following file:
Generated on Sun Jul 30 22:56:45 2006 for Archon by  doxygen 1.4.4