Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoGLFormat.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#if !defined( SO_GLFORMAT_H )
24#define SO_GLFORMAT_H
25
26
27#include <Inventor/sys/port.h>
28#include <Inventor/SbBase.h>
30
32namespace renderengine
33{
34 namespace utils
35 {
36 namespace GL
37 {
38 class Format;
39 }
40 }
41}
55{
56public:
57
62
68
72 SoGLFormat( const SoGLFormat& refFormat );
73
77 virtual ~SoGLFormat();
78
82 void setDoubleBuffersEnabled( const bool enabled );
83
87 bool hasDoubleBuffers() const;
88
92 bool hasDepth() const;
93
97 void setDepthEnabled( const bool enable );
98
102 void setDepthBits( const int bits );
103
107 int getDepthBits() const;
108
112 bool hasAlpha() const;
113
117 void setAlphaEnabled( const bool enable );
118
122 void setSampleBuffersEnabled( const bool enable );
123
127 bool hasSampleBuffers() const;
128
132 void setSamplesCount( const int countSamples );
133
137 int getSamplesCount() const;
138
142 void setStereoEnabled( const bool enable );
143
147 bool hasStereo() const;
148
152 void setRgbEnabled( const bool enabled );
153
157 bool hasRgb() const;
158
159 void setRedBits(int bits);
160
161 int getRedBits() const;
162
163 void setGreenBits(int bits);
164
165 int getGreenBits() const;
166
167 void setBlueBits(int bits);
168
169 int getBlueBits() const;
170
171 void setAlphaBits(int bits);
172
173 int getAlphaBits() const;
174
179
184
188 void setStencilBufferEnabled( const bool enabled );
189
193 bool hasStencilBuffer() const;
194
198 void setStencilBufferBits( const int size );
199
204
208 void setAccumBufferEnabled( const bool enabled );
209
213 bool hasAccumBuffer() const;
214
218 void setAccumBufferBits( const int size );
219
224
229 bool isAvailable() const;
230
237
242 bool activate();
243
248
254
269 void setCompositionRequired( const bool required );
270
275
287 void setGDISupportRequired( const bool required );
288
293
298
303
308
313
322
326 void setVisualInfoId( const int viId );
327
331 int getVisualInfoId() const;
332
336 void setOpenglAttributes( const SbGlContextHelper::Display& display, int pfd, int* attributes,
337 int* results );
338
343
354
359
360private:
361
367 bool isGDIAvailable() const;
368
374 bool isRDPMode() const;
375
376#if defined(_WIN32)
381 SoGLFormat( const SbGlContextHelper::Display& display, bool copyDC);
382
387 void setDisplay( const SbGlContextHelper::Display& display, bool copyDC);
388#endif //_WIN32
389
390private:
391
395 void init();
396
397 void resetDetectedData();
398
399private:
400 renderengine::utils::GL::Format* m_format;
401};
402
403#endif // SO_GLFORMAT_H
404
405
virtual void enable(QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL)
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> OpenGL pixel for...
Definition SoGLFormat.h:55
int getGreenBits() const
void setVisualInfo(const SbGlContextHelper::VisualInfo &visualInfo)
Sets the visual info associated with this format.
void setAlphaBits(int bits)
bool hasStencilBuffer() const
Returns true if this format has a stencil buffer.
int getAlphaBits() const
const SbGlContextHelper::Display & getDisplay() const
Returns the display on which this format is attached.
bool isCompositionRequired() const
Returns true if composition is required for this pixel format.
int getRedBits() const
void setStencilBufferEnabled(const bool enabled)
Sets the stencil buffer state of this format.
SoGLFormat(const SbGlContextHelper::Display &display)
Constructor that uses the default format and stores the specified display.
void setGDISupportRequired(const bool required)
Sets the GDI support requirement of the pixel format.
bool hasSampleBuffers() const
Returns true if this format has sample buffers.
void setDepthBits(const int bits)
Sets the depth buffer bits of this format.
void setDoubleBuffersEnabled(const bool enabled)
Sets the double buffering state of this format.
void setDisplay(const SbGlContextHelper::Display &display)
Sets the display associated with this format.
void setVisualInfoId(const int viId)
Sets the PFD id associated with this visualInfo.
void setDepthEnabled(const bool enable)
Sets the depth buffer state of this format.
void setAccumBufferEnabled(const bool enabled)
Sets the accumulation buffer state of this format.
SoGLFormat(const SoGLFormat &refFormat)
Constructor that initializes the format from the specified one.
bool hasDepth() const
Returns true if this format has a depth buffer.
virtual ~SoGLFormat()
Destructor.
bool hasAccumBuffer() const
Returns true if this format has an accumulation buffer.
void setBlueBits(int bits)
bool isSoftwareRendererRequired() const
Returns true if the software renderer is required for this format.
static SoGLFormat getDefaultFormat()
Returns the default format used.
int getSamplesCount() const
Returns the samples count of this format.
void setStereoEnabled(const bool enable)
Sets the stereo state of this format.
bool hasFloatColorBuffer() const
Returns true if this format has a float color buffer.
int getVisualInfoId() const
Returns the PFD associated with this visualInfo.
bool hasStereo() const
Returns true if this format has stereo.
void setSoftwareRendererRequired(const bool enable)
Specified that a software renderer is required for this format.
bool activate()
Tries to activate the format for the current display.
bool isAccelerationRequired() const
Returns TRUE if hardware acceleration support is required for this pixel format.
const SbGlContextHelper::VisualInfo & getVisualInfo() const
Returns the visual info of the format.
void setAccumBufferBits(const int size)
Sets the accumulation buffer bits of this format.
void setCompositionRequired(const bool required)
Sets the composition requirement of the pixel format.
bool hasAlpha() const
Returns true if this format has an alpha channel.
void setStencilBufferBits(const int size)
Sets the stencil buffer bits of this format.
void setSampleBuffersEnabled(const bool enable)
Sets the sample buffers state of this format.
int getDepthBits() const
Returns the depth buffer bits of this format.
void setGreenBits(int bits)
void setAccelerationRequired(const bool enable)
Sets the hardware acceleration support requirement of this pixel format.
int getBlueBits() const
int getAccumBufferBits() const
Returns the accumulation buffer bits of this format.
int getStencilBufferBits() const
Returns the stencil buffer bits of this format.
SoGLFormat getNearest() const
Returns the supported format which is the nearest available on this system.
bool hasRgb() const
Returns true if this format is RGB.
SoGLFormat & operator=(const SoGLFormat &ref)
Operator = to copy the data.
void setFloatColorBufferEnabled(const bool enable)
Sets the Float color buffer state of this format.
bool isAvailable() const
Returns true if this format is available on the system.
SoGLFormat()
Default constructor -> we set the default format.
void setSamplesCount(const int countSamples)
Sets the samples count of this format.
void setOpenglAttributes(const SbGlContextHelper::Display &display, int pfd, int *attributes, int *results)
Sets the format according to the openGL attributes.
bool isGDISupportRequired() const
Returns true if GDI support is required for this pixel format.
bool hasDoubleBuffers() const
Returns true if this format is double buffered.
void setRedBits(int bits)
void setAlphaEnabled(const bool enable)
Sets the alpha channel state of this format.
void setRgbEnabled(const bool enabled)
Sets the RGB state of this format.
size_t size() const