SbGlContextHelper Namespace Reference

Platform indepent functions for OpenGL context handling. More...

Typedefs

typedef ::DisplayDisplay
typedef GLXContext GLContext
typedef void * VisualInfo
typedef GLXDrawable Drawable

Functions

GLContext getCurrentContext ()
Display getCurrentDisplay ()
Drawable getCurrentDrawable ()
bool isValidDisplay (Display dpy)
VisualInfo getWindowVisualInfo (Display dpy, Drawable drawable)
VisualInfo getWindowVisualInfo (Display dpy, Drawable drawable, GLContext ctx)
void releaseVisualInfo (VisualInfo visualInfo)
GLContext createContext (Display dpy, VisualInfo vis, GLContext shareList, bool direct, int layer=0)
bool destroyContext (Display dpy, GLContext ctx)
bool makeCurrent (Display dpy, Drawable drawable, GLContext ctx)
bool shareContext (Display dpy, GLContext srcCtx, GLContext newCtx)

Detailed Description

Platform indepent functions for OpenGL context handling.


Typedef Documentation


Function Documentation

GLContext SbGlContextHelper::createContext ( Display  dpy,
VisualInfo  vis,
GLContext  shareList,
bool  direct,
int  layer = 0 
)

Create a new context.

Parameters:
dpy specifies the display (device context on win32)
vis specifies the visual (must be set to 0 on win32)
shareList context to sharelist with (0 means no sharing); it is not used on win32, use shareContext for sharing.
direct set to true for direct rendering (meaningless on win32)
layer Layer on which we want to create the context, 0 (default) for the main plane.
bool SbGlContextHelper::destroyContext ( Display  dpy,
GLContext  ctx 
)

Destroy given context.

GLContext SbGlContextHelper::getCurrentContext (  ) 

Return the current active context.

Display SbGlContextHelper::getCurrentDisplay (  ) 

Return the current active display.

Drawable SbGlContextHelper::getCurrentDrawable (  ) 

Return the current active drawable.

VisualInfo SbGlContextHelper::getWindowVisualInfo ( Display  dpy,
Drawable  drawable,
GLContext  ctx 
)

Returns the VisualInfo used for the specified drawable.

Use releaseVisualInfo() to free the returned pointer.

VisualInfo SbGlContextHelper::getWindowVisualInfo ( Display  dpy,
Drawable  drawable 
)

Returns the VisualInfo used for the specified drawable.

Use releaseVisualInfo() to free the returned pointer.

bool SbGlContextHelper::isValidDisplay ( Display  dpy  ) 

Return true if the specified display is valid.

bool SbGlContextHelper::makeCurrent ( Display  dpy,
Drawable  drawable,
GLContext  ctx 
)

Make given context current.

Parameters:
dpy specifies the display (device context on win32)
drawable specifies a drawable (0 on win32)
ctx specifies the OpenGL context to switch to.
void SbGlContextHelper::releaseVisualInfo ( VisualInfo  visualInfo  ) 

Release a VisualInfo returned by getWindowVisualInfo().

bool SbGlContextHelper::shareContext ( Display  dpy,
GLContext  srcCtx,
GLContext  newCtx 
)

Tries to share passed context.

Parameters:
dpy specifies the display (device context on win32)
srcCtx specifies the previously existing context
newCtx specifies the context to share with previously existing context srcCtx. This function only applies on Microsoft Windows Platform. Please refer to wglShareLists() to know more about context sharing.

Open Inventor Toolkit reference manual, generated on 11 Nov 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/