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)
bool destroyContext (Display dpy, GLContext ctx)
bool makeCurrent (Display dpy, Drawable drawable, GLContext ctx)
SoINTERNAL GLContext createContextAttribs (Display dpy, VisualInfo vis, GLContext shareList, bool direct, const std::vector< int > &attribs)

Detailed Description

Platform indepent functions for OpenGL context handling.


Typedef Documentation

typedef GLXDrawable SbGlContextHelper::Drawable
typedef GLXContext SbGlContextHelper::GLContext

Function Documentation

GLContext SbGlContextHelper::createContext ( Display  dpy,
VisualInfo  vis,
GLContext  shareList,
bool  direct 
)

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)
SoINTERNAL GLContext SbGlContextHelper::createContextAttribs ( Display  dpy,
VisualInfo  vis,
GLContext  shareList,
bool  direct,
const std::vector< int > &  attribs 
)

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)
attribs holds options for context creation
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().


Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/