SOXTGLWIDGET(3iv)
π SoXtGLWidget π
okay so bestie, welcome to the SoXtGLWidget(3IV) manual page β yes, that's the manual name right there, section 3IV, and it's giving deep lore energy. this is the one that wraps GLwMDraw so you can do OpenGL rendering inside a motif widget. slay. π
πΈ INHERITS FROM πΈ
SoXtComponent > SoXtGLWidget
so it's a whole family tree situation β SoXtGLWidget is the child, SoXtComponent is the parent, and it's inheriting all that main character energy. π
β¨ SYNOPSIS β¨
#include <Inventor/Xt/SoXtGLWidget.h>
π«Ά Methods from class SoXtGLWidget:
void setBorder(SbBool onOrOff)
SbBool isBorder() const
virtual void setDoubleBuffer(SbBool onOrOff)
SbBool isDoubleBuffer()
Window getNormalWindow()
Window getOverlayWindow()
GLXContext getNormalContext()
GLXContext getOverlayContext()
Widget getNormalWidget()
Widget getOverlayWidget()
virtual void setNormalVisual(XVisualInfo *vis)
XVisualInfo * getNormalVisual()
virtual void setOverlayVisual(XVisualInfo *vis)
XVisualInfo * getOverlayVisual()
void setDrawToFrontBufferEnable(SbBool enableFlag)
SbBool isDrawToFrontBufferEnable() const
π¦ Methods from class SoXtComponent:
virtual void show()
virtual void hide()
SbBool isVisible()
Widget getWidget() const
SbBool isTopLevelShell() const
Widget getShellWidget() const
Widget getParentWidget() const
void setSize(const SbVec2s &size)
SbVec2s getSize()
Display * getDisplay()
void setTitle(const char *newTitle)
const char * getTitle() const
void setIconTitle(const char *newIconTitle)
const char * getIconTitle() const
void setWindowCloseCallback(SoXtComponentCB *func, void
*data = NULL)
static SoXtComponent * getComponent(Widget w)
const char * getWidgetName() const
const char * getClassName() const
π DESCRIPTION π
okay so here's the tea. This abstract base class is literally a C++ wrapper around the GLwMDraw widget. it lets you do OpenGL rendering inside a motif widget, and it's the blueprint that SoXtRenderArea uses. π
SoXtGLWidget uses a form widget around two separate GLwMDraw widgets β one for single buffering, one for double buffering β and it's got routines to hand you back the appropriate windows. two widgets, one vibe. it's giving duality. β¨
and here's the part where the subclasses get to shine: subclasses only need to redefine the redraw() routine for rendering, plus the processEvent() routine if they're interested in receiving X events. that's it. that's the homework. no cap. π
π METHODS π
π setBorder / isBorder
void setBorder(SbBool onOrOff)
SbBool isBorder() const
show and hide the border around the glx widgets (thickness 3). default is no border (FALSE). and lowkey a fun lil plot twist: the SoXtRenderArea subclass defaults turns the border on by default. so if you're confused why your SoXtRenderArea looks framed and your plain SoXtGLWidget doesn't β that's why bestie. πΌοΈ
π setDoubleBuffer / isDoubleBuffer
virtual void setDoubleBuffer(SbBool onOrOff)
SbBool isDoubleBuffer()
the routine that dynamically changes between single and double buffering. default is double buffer off. (and yup, the SoXtRenderArea subclass makes it double buffer by default.) flip it whenever, it's dynamic, it's flexible, it's iconic. π
π getNormalWindow / getOverlayWindow / getNormalContext / getOverlayContext / getNormalWidget / getOverlayWidget
Window getNormalWindow()
Window getOverlayWindow()
GLXContext getNormalContext()
GLXContext getOverlayContext()
Widget getNormalWidget()
Widget getOverlayWidget()
grab the current normal and overlay GLX windows, contexes and widgets. you need these as arguments to glXMakeCurrent() when you're doing drawing in the normal or overlay planes. ποΈ
β οΈ Note: These should not be cached by users because they will change as single/double buffering changes. bestie do NOT save these in a variable and walk away, they will betray you. π
π setNormalVisual / getNormalVisual / setOverlayVisual / getOverlayVisual
virtual void setNormalVisual(XVisualInfo *vis)
XVisualInfo * getNormalVisual()
virtual void setOverlayVisual(XVisualInfo *vis)
XVisualInfo * getOverlayVisual()
specify exactly what the visual should be for the normal and overlay window. this lets you create all possible visuals supported by OpenGL. the XVisualInfo structure should be a valid OpenGL visual returned by glXChooseVisual(). π¨
so here's the important bit: this structure will be copied by the SoXtGLWidget β so the application is responsible for freeing the visual info with XFree() when done. don't forget, fr fr. π«Ά
and why are the setting methods virtual? because derived classes can know when the visual is changing. communication, bestie. it's a whole relationship. π
π setDrawToFrontBufferEnable / isDrawToFrontBufferEnable
void setDrawToFrontBufferEnable(SbBool enableFlag)
SbBool isDrawToFrontBufferEnable() const
okay this one has LORE. Inventor 2.1 changed the behavior of double buffered windows to redraw temporary to the front buffer when an expose event is received, or when a new sceneGraph() is set on an SoXtRenderArea. this does not apply for general interactive rendering. π«
the idea? it's better to see something redraw (especially if it's slow) than to see garbage in the window (in the expose case), or an old invalid scene graph (in the SoXtRenderArea::setSceneGraph() case). makes sense tbh. seeing garbage is not the vibe. π
this API enables you to turn this functionality OFF if, for some reason, you are unable to prevent repeated expose from causing a redraw β which is bad and should be fixed, because it gets worse for large scenes. this will be the case for example if you can't create a pulldown menu in the popup planes. π
NOTE: this api might be removed in some future releases and is only intended as a porting help for Inventor2.0to2.1. so likeβ¦ use it, but don't get attached. it's a situationship. π
π SEE ALSO π
SoXtComponent, SoXtRenderArea
and that's the whole page bestie!! π this was SoXtGLWidget(3IV) β manual name right there, section 3IV, and honestly? the footer's just echoing SoXtGLWidget(3IV)() back at us like a lil mirror selfie with no extra version or date tea attached. go forth and render, you absolute legend. periodt. β¨π¦ππππ
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms