Back to the Equalizer website

glAsync Namespace Reference


Detailed Description

Provides asynchronous OpenGL functions.

The glAsync functions deliver asynchronous OpenGL downloads in the spirit of the SGIX_async extension. The asynchronous execution of certain rendering commands can improve the overall performance of the application. The ARB_sync extension provides now a better way for asynchronous operations.

A second thread uses a shared context to the main context for asynchronous downloads. The application can map more than one context, but only one context can be current at a given time. All commands are executed in the order they are submitted. The asynchronous helper thread is only running when at least one context is mapped.

The functions are not thread-safe. For thread-safety and performance multi-threaded rendering codes are advised to use one glAsync::Thread instance per rendering thread.


Classes

class  Thread
 For multi-threaded rendering, use one instance of this class for each rendering thread. More...

Functions

Bool XMapContext (Display *display, XVisualInfo *visInfo, GLXContext context)
 Map a context to be used for asynchronous functions.
void XUnmapContext (Display *display, GLXContext context)
 Unmap a context to be used for asynchronous functions.
Bool XMakeCurrent (Display *display, GLXContext context)
 Attach a rendering context to the asynchronous thread.
void bindTexture (GLenum target, GLuint texture)
 Bind a named texture to a texturing target for the following asynchronous texture operations on the target.
GLuint texImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
 Specify a two-dimensional texture image.
GLuint texImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
 Specify a three-dimensional texture image.
Bool poll (GLuint marker)
 Poll for the completion of an operation.
Bool isIdle ()
 Poll for the completion of all operations.
void finish (GLuint marker)
 Finish an operation.
void finishAll ()
 Finish all pending operations.

Function Documentation

Bool glAsync::XMapContext ( Display *  display,
XVisualInfo *  visInfo,
GLXContext  context 
)

Map a context to be used for asynchronous functions.

This function creates a hidden shared context and drawable to be used the asynchronous functions.

Parameters:
display the connection to the X server.
visInfo the visual information.
context the GLX rendering context.
Returns:
True on success, False otherwise.

void glAsync::XUnmapContext ( Display *  display,
GLXContext  context 
)

Unmap a context to be used for asynchronous functions.

This function deregisters the context from the glAsync library and deallocates all associated resources. For performance reasons it does not check that all outstanding commands for this context have been executed. The application has to explicitly wait for the commands to be finished before calling the function.

Parameters:
display the connection to the X server.
context the GLX rendering context.
See also:
finish(), finishAll()

Bool glAsync::XMakeCurrent ( Display *  display,
GLXContext  context 
)

Attach a rendering context to the asynchronous thread.

Parameters:
display the connection to the X server.
context the GLX rendering context.
Returns:
True if successful, False otherwise.
See also:
glXMakeCurrent

void glAsync::bindTexture ( GLenum  target,
GLuint  texture 
)

Bind a named texture to a texturing target for the following asynchronous texture operations on the target.

See also:
glBindTexture

GLuint glAsync::texImage2D ( GLenum  target,
GLint  level,
GLint  internalformat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

Specify a two-dimensional texture image.

Returns:
the marker associated with the asynchronous operation.
See also:
glTexImage2D

GLuint glAsync::texImage3D ( GLenum  target,
GLint  level,
GLint  internalformat,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

Specify a three-dimensional texture image.

Returns:
the marker associated with the asynchronous operation.
See also:
glTexImage3D

Bool glAsync::poll ( GLuint  marker  ) 

Poll for the completion of an operation.

Parameters:
marker the marker of the operation.
Returns:
True if the operation has completed, False if it is in progress.

Bool glAsync::isIdle (  ) 

Poll for the completion of all operations.

Returns:
True if the helper thread is idle, i.e. all operations have completed, False if there are still outstanding operations.

void glAsync::finish ( GLuint  marker  ) 

Finish an operation.

Finish blocks until the operation has completed.

Parameters:
marker the marker of the operation.

void glAsync::finishAll (  ) 

Finish all pending operations.


Generated on Thu Apr 19 15:06:47 2007 for Asynchronous OpenGL Library by  doxygen 1.5.1