51# include <Inventor/Qt/SoQtGLWidget.h>
53# include <Inventor/Win/SoWinGLWidget.h>
56#ifndef _SO_XT_GL_WIDGET_H_
57#define _SO_XT_GL_WIDGET_H_
59#include <X11/Intrinsic.h>
60#include <Inventor/helpers/SbGlContextHelper.h>
61#include <Inventor/Xt/SoXtComponent.h>
62#include <Inventor/components/SoGLGraphicConfigTemplate.h>
63#include <Inventor/components/SoGLGraphicDevice.h>
64#include <Inventor/components/SoGLGraphicConfig.h>
65#include <Inventor/devices/SoGLFormat.h>
66#include <Inventor/threads/SbThread.h>
67#include <Inventor/nodes/SoFullSceneAntialiasing.h>
69#include <Inventor/Gui/SoGuiGLWidget.h>
70#include <Inventor/devices/SoGLContext.h>
72class SoXtRemoteRenderInfo;
298 void setRemoteRenderPbufferEnable(
SbBool enable ) { m_remoteRenderPbufferEnable = enable; }
299 SbBool isRemoteRenderPbufferEnable()
const {
return m_remoteRenderPbufferEnable; }
301 float getLowResPercent() {
return m_lowResPercent; }
309 void syncFromCurrentConfig();
312 void syncToCurrentConfigTemplate( XVisualInfo* newvis );
314 SbBool currentGraphicConfigTemplateIsUsed;
323 SbBool isFsaaSupportHighQuality();
324 SbBool isFsaaHighQuality();
334 SbBool m_isFloatingPointRendering;
339 static SbBool swapNormalBuffersCB(
void *data);
340 static SbBool bindNormalCurrentCB(
void *data);
341 static SbBool unbindNormalCurrentCB(
void *data);
342 static void* getNormalWindowCB(
void *data);
343 static void* getCurrentDisplayCB(
void *data);
353 void updateCurrentDeviceAndConfig( Display* display );
355 SbBool currentGraphicConfigIsUsed;
357 SbBool currentGraphicDeviceIsUsed;
365 const char* name = NULL,
366 SbBool buildInsideParent = TRUE,
367 int glModes = SO_GLX_RGB | SO_GLX_ZBUFFER | SO_GLX_STENCIL,
382 virtual void redraw() = 0;
383 virtual void processEvent( XAnyEvent* anyevent );
390 virtual void initGraphic();
391 virtual void sizeChanged(
const SbVec2s& );
393 virtual void widgetChanged( SoWidget newWidget );
399 void setGlxSize(
SbVec2s newSize );
400 const SbVec2s& getGlxSize()
const {
return m_guiGLWidget->getGlxSize(); }
409 void setStereoBuffer(
SbBool flag );
410 SbBool isStereoBuffer() {
return (m_guiGLWidget->getGLModes() & SO_GLX_STEREO); }
413 SbBool isRGBMode() {
return (m_guiGLWidget->getGLModes() & SO_GLX_RGB); }
415#if defined(__linux__)
416 void allocCell( Display *display, Colormap cmap, XColor *colorcells,
int ncolors,
int colorMapSize );
420 Colormap getColorMap()
const
421 {
return m_guiGLWidget->getColorMap(); }
427 SoWidget buildWidget( SoWidget parent );
428 SoWidget getGlxMgrWidget() {
return mgrWidget; }
431 enum RemoteRenderEnabled
437 RemoteRenderEnabled m_remoteRenderMode;
439 SoXtRemoteRenderInfo* m_remoteRenderInfo;
440 SbBool m_remoteRenderPbufferEnable;
442 float m_lowResLowPercent;
443 float m_lowResHighPercent;
444 float m_lowResPercent;
446 void remoteRenderInit();
447 void remoteRenderCleanup();
448 void remoteRenderGinitCB( SoWidget w );
450 void remoteRenderResizeCB();
451 void remoteRenderSendImage();
452 void remoteRenderSendLowResRender();
453 XVisualInfo* remoteRenderChooseVisual();
454 void remoteRenderFatalError(
const char* methodName,
const char* message );
456 void setLowResLowPercent(
float percent ) { m_lowResLowPercent = percent;}
457 void setLowResHighPercent(
float percent ) { m_lowResHighPercent = percent;}
458 float getLowResLowPercent()
const {
return m_lowResLowPercent;}
459 float getLowResHighPercent()
const {
return m_lowResHighPercent;}
461 virtual void setLowResPercent(
float newLowres ) {m_lowResPercent = newLowres;}
464 SbThreadId_t dwThreadId;
465 SbThreadId_t getThreadId() {
return dwThreadId; };
466 void setThreadId( SbThreadId_t
id ) { dwThreadId=id; };
468 virtual void onExpose();
473 SoWidget m_widgetNormal;
489 void buildNormalGLXWidget( XVisualInfo* vis = NULL );
490 void destroyNormalWindows(
SbBool normalCall=TRUE);
494 void destroyWindow( SoWidget widget );
496 static SbBool onGLFormatChangeCallback(
SoGLFormat& format,
void* userData );
506 bool m_stereoActiveDelayed;
507 bool m_stereoBufferFlag;
509 SbBool m_singleBufferExpected;
513 void constructorCommon(
int glModes,
SbBool buildNow );
515 SbBool remoteRenderGinitCB_pbuffer( SoWidget w );
Class for smart character strings.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Antialiasing par...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> OpenGL context m...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Defines an OpenG...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Defines an OpenG...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Represents an Op...
Smart pointer for any class inheriting SoRefCounter.
AntialiasingMode
Enum which indicates the desired antialiasing algorithm.
@ AUTO
This is the default mode for antialiasing.
Abstract base class for all Open Inventor components.