~ubuntu-branches/ubuntu/oneiric/soqt/oneiric

« back to all changes in this revision

Viewing changes to build/msvc7/src/Inventor/Qt/SoQtGLWidgetCommon.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-03-01 11:41:00 UTC
  • mfrom: (1.1.4 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090301114100-f4zz3n1oasa52fgk
Tags: 1.4.2~svn20090224-2
* Upload upstream SVN head version containing fixes to build with Coin 3
  (Closes: #515729, #515736, #515742).  Upstream indicated to me that
  SVN is stable enough to release.

* control: Update Standards-Version to 3.8.0; no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************\
2
 
 *
3
 
 *  This file is part of the Coin 3D visualization library.
4
 
 *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
5
 
 *
6
 
 *  This library is free software; you can redistribute it and/or
7
 
 *  modify it under the terms of the GNU General Public License
8
 
 *  ("GPL") version 2 as published by the Free Software Foundation.
9
 
 *  See the file LICENSE.GPL at the root directory of this source
10
 
 *  distribution for additional information about the GNU GPL.
11
 
 *
12
 
 *  For using Coin with software that can not be combined with the GNU
13
 
 *  GPL, and for taking advantage of the additional benefits of our
14
 
 *  support services, please contact Systems in Motion about acquiring
15
 
 *  a Coin Professional Edition License.
16
 
 *
17
 
 *  See <URL:http://www.coin3d.org/> for more information.
18
 
 *
19
 
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
 
 *  <URL:http://www.sim.no/>.
21
 
 *
22
 
\**************************************************************************/
23
 
 
24
 
// src/Inventor/Qt/SoQtGLWidgetCommon.cpp.  Generated from SoGuiGLWidgetCommon.cpp.in by configure.
25
 
 
26
 
#define PRIVATE(obj) ((SoGuiGLWidgetP *)(obj->pimpl))
27
 
 
28
 
// *************************************************************************
29
 
 
30
 
/*!
31
 
  \class SoQtGLWidget SoQtGLWidget.h Inventor/Qt/SoQtGLWidget.h
32
 
  \brief The SoQtGLWidget class manages OpenGL contexts.
33
 
  \ingroup components
34
 
 
35
 
  This is the basic, abstract component class which sets up an OpenGL
36
 
  canvas for its subclasses.
37
 
 
38
 
  Application programmers will normally not use this class directly,
39
 
  but rather through the interface of either its direct descendent;
40
 
  SoQtRenderArea, or through one of the "rapid application
41
 
  development"-style viewer subclasses.
42
 
 
43
 
  \if SOQT_DOC
44
 
 
45
 
  An important thing to know about embedding SoQtGLWidget derived
46
 
  components into other Qt widgets is that you need to set up
47
 
  "focus proxying" to have events still be sent to the OpenGL canvas
48
 
  widget. This is true for both the SoQtRenderArea aswell as all
49
 
  the viewer components (like SoQtExaminerViewer,
50
 
  SoQtPlaneViewer etc).
51
 
 
52
 
  As an example, if you embed an SoQtExaminerViewer inside a QFrame
53
 
  like this:
54
 
 
55
 
  \code
56
 
  QMainWindow * toplevel = new QMainWindow;
57
 
  QFrame * frame = new QFrame(toplevel);
58
 
  SoQtExaminerViewer * viewer = new SoQtExaminerViewer(toplevel);
59
 
  \endcode
60
 
 
61
 
  ...events from the keyboard will not always automatically be
62
 
  forwarded to the viewer OpenGL canvas. This is the code you need to
63
 
  add in this case:
64
 
 
65
 
  \code
66
 
  toplevel->setFocusProxy(viewer->getWidget());
67
 
  \endcode
68
 
 
69
 
  \endif
70
 
 
71
 
  \if SOWIN_DOC
72
 
 
73
 
  For debugging purposes, SoWinGLWidget provides the
74
 
  OIV_FORCE_PIXEL_FORMAT environment variable to make it possible to
75
 
  override the pixel format chosen by the internal attribute match
76
 
  algorithm.
77
 
 
78
 
  \endif
79
 
*/
80
 
 
81
 
// *************************************************************************
82
 
 
83
 
#ifdef HAVE_CONFIG_H
84
 
#include <config.h>
85
 
#endif // HAVE_CONFIG_H
86
 
 
87
 
#include <Inventor/Qt/common/gl.h>
88
 
#include <Inventor/Qt/SoQtGLWidget.h>
89
 
#include <Inventor/Qt/SoQtGLWidgetP.h>
90
 
 
91
 
// *************************************************************************
92
 
 
93
 
// All shared documentation for functions with specific
94
 
// implementations in the individual toolkits.
95
 
 
96
 
/*!
97
 
  \fn SoQtGLWidget::SoQtGLWidget(QWidget * const parent, const char * const name, const SbBool embed, const int glmodes, const SbBool build)
98
 
 
99
 
  The constructor is protected, as this is an abstract class to only
100
 
  be used by it's subclasses.
101
 
*/
102
 
 
103
 
/*!
104
 
  \fn SoQtGLWidget::~SoQtGLWidget()
105
 
 
106
 
  Clean up all use of internal resources.
107
 
 
108
 
  The destructor is protected, as this is an abstract class to only be
109
 
  used by it's subclasses.
110
 
*/
111
 
 
112
 
/*!
113
 
  \fn void SoQtGLWidget::setBorder(const SbBool enable)
114
 
 
115
 
  Specify whether or not there should be a border framing the OpenGL
116
 
  canvas. The border will be 2 pixels wide.
117
 
 
118
 
  The default is to display the OpenGL canvas with no border.
119
 
 
120
 
  \sa isBorder()
121
 
*/
122
 
 
123
 
/*!
124
 
  \fn SbBool SoQtGLWidget::isBorder(void) const
125
 
 
126
 
  Returns whether or not there's a border framing the OpenGL canvas.
127
 
 
128
 
  \sa setBorder()
129
 
*/
130
 
 
131
 
/*!
132
 
  \fn void SoQtGLWidget::setOverlayRender(const SbBool onoff)
133
 
 
134
 
  Turn on or off the use of overlay planes.
135
 
 
136
 
  \sa isOverlayRender()
137
 
*/
138
 
 
139
 
/*!
140
 
  \fn SbBool SoQtGLWidget::isOverlayRender(void) const
141
 
 
142
 
  Returns a flag indicating whether or not overplay planes are
143
 
  currently used.
144
 
 
145
 
  \sa setOverlayRender()
146
 
*/
147
 
 
148
 
/*!
149
 
  \fn void SoQtGLWidget::setDoubleBuffer(const SbBool enable)
150
 
 
151
 
  Switch between single and double buffer mode for the OpenGL canvas.
152
 
  The default is to use a single buffer canvas.
153
 
 
154
 
  \sa isDoubleBuffer()
155
 
*/
156
 
 
157
 
/*!
158
 
  \fn SbBool SoQtGLWidget::isDoubleBuffer(void) const
159
 
 
160
 
  Returns the status of the buffer mode.
161
 
 
162
 
  \sa setDoubleBuffer()
163
 
*/
164
 
 
165
 
/*!
166
 
  \fn void SoQtGLWidget::setQuadBufferStereo(const SbBool enable)
167
 
 
168
 
  Enables or disables OpenGL quad buffer stereo.
169
 
*/
170
 
 
171
 
/*!
172
 
  \fn SbBool SoQtGLWidget::isQuadBufferStereo(void) const
173
 
 
174
 
  Returns \c TRUE if quad buffer stereo is enabled for this widget.
175
 
*/
176
 
 
177
 
/*!
178
 
  \fn void SoQtGLWidget::setAccumulationBuffer(const SbBool enable)
179
 
 
180
 
  Enables/disables the OpenGL accumulation buffer.
181
 
 
182
 
  For general information about accumulation buffers, confer with your
183
 
  OpenGL reference documentation.
184
 
 
185
 
  By default, the accumulation buffer will be attempted disabled.
186
 
  Whether or not it will \e actually be disabled depends on what
187
 
  OpenGL contexts are available on the system. It is perfectly
188
 
  possible that the only usable contexts with regard to the other
189
 
  settings (like double buffering and RGBA mode versus color index
190
 
  mode) causes the context selection to choose an OpenGL format that
191
 
  contains an accumulation buffer, even though it was not
192
 
  requested.
193
 
 
194
 
  Vice versa, one is not guaranteed to get accumulation buffers even
195
 
  when requested through this function, either because they are not
196
 
  available, or because they are only available in combination with
197
 
  other OpenGL context settings that are not wanted (like single
198
 
  buffers, non-accellerated rendering, etc).
199
 
 
200
 
  If you try to enable accumulation buffers by using this function,
201
 
  you should therefore in succession use the
202
 
  SoQtGLWidget::getAccumulationBuffer() to query whether or not an
203
 
  accumulation buffer could actually be set up.
204
 
 
205
 
  \sa SoQtRenderArea::setAntiAliasing()
206
 
*/
207
 
 
208
 
/*!
209
 
  \fn SbBool SoQtGLWidget::getAccumulationBuffer(void) const
210
 
 
211
 
  Returns whether the OpenGL accumulation buffer is enabled.
212
 
 
213
 
  The returned flag will indicate whether or not accumulation buffers
214
 
  are \e actually present, and not just parrot the input value to
215
 
  SoQtGLWidget::setAccumulationBuffer(). See documentation of that
216
 
  function for more information.
217
 
*/
218
 
 
219
 
/*!
220
 
  \fn void SoQtGLWidget::setStencilBuffer(const SbBool enable)
221
 
 
222
 
  Enables/disables the OpenGL stencil buffer.
223
 
 
224
 
  For general information about stencil buffers, confer with your
225
 
  OpenGL reference documentation.
226
 
 
227
 
  By default, the stencil buffer will be attempted disabled, but the
228
 
  same notes apply for stencil buffers as for accumulation
229
 
  buffers. For an explanation on the issue of stencil and accumulation
230
 
  buffer availability, see the function documentation of
231
 
  SoQtGLWidget::setAccumulationBuffer().
232
 
*/
233
 
 
234
 
/*!
235
 
  \fn SbBool SoQtGLWidget::getStencilBuffer(void) const
236
 
 
237
 
  Returns whether the OpenGL stencil buffer is enabled.
238
 
 
239
 
  The returned flag will indicate whether or not stencil buffers are
240
 
  \e actually present, in the same manner as for
241
 
  SoQtGLWidget::getAccumulationBuffer(). See documentation of
242
 
  SoQtGLWidget::setStencilBuffer().
243
 
*/
244
 
 
245
 
/*!
246
 
  \fn void SoQtGLWidget::setAlphaChannel(const SbBool enable)
247
 
 
248
 
  Enables/disables the alpha channel for the OpenGL context.
249
 
*/
250
 
 
251
 
/*!
252
 
  \fn SbBool SoQtGLWidget::getAlphaChannel(void) const
253
 
 
254
 
  Returns whether the alpha channel is enabled for the OpenGL context.
255
 
*/
256
 
 
257
 
/*!
258
 
  \fn void SoQtGLWidget::setDrawToFrontBufferEnable(const SbBool enable)
259
 
 
260
 
  If this is set to \c TRUE, rendering will happen in the front buffer
261
 
  even if the current rendering mode is double buffered.
262
 
*/
263
 
 
264
 
/*!
265
 
  \fn SbBool SoQtGLWidget::isDrawToFrontBufferEnable(void) const
266
 
  \sa setDrawToFrontBufferEnable()
267
 
*/
268
 
 
269
 
/*!
270
 
  \fn QWidget * SoQtGLWidget::buildWidget(QWidget * parent)
271
 
 
272
 
  This method builds the component contents in the given \a parent
273
 
  widget. For subclasses adding new user interface items, this method
274
 
  is typically overridden in the following manner:
275
 
 
276
 
  \code
277
 
  QWidget * MyOwnViewer::buildWidget(QWidget * parent)
278
 
  {
279
 
     QWidget * superw = <superclass>::buildWidget(parent);
280
 
     // [then move superw within MyOwnViewer framework and add own
281
 
     // user interface components]
282
 
  }
283
 
  \endcode
284
 
*/
285
 
 
286
 
/*!
287
 
  \fn virtual void SoQtGLWidget::redraw(void)
288
 
 
289
 
  This method is invoked when the GL buffer needs to be redrawn.
290
 
 */
291
 
 
292
 
/*!
293
 
  \var SbBool SoQtGLWidget::waitForExpose
294
 
 
295
 
  If this is \c TRUE, rendering should not be done yet. Upon the first
296
 
  expose event of a newly created OpenGL widget, this variable will
297
 
  be set to \c FALSE.
298
 
*/
299
 
 
300
 
/*!
301
 
  \var SbBool SoQtGLWidget::drawToFrontBuffer
302
 
 
303
 
  If this is \c TRUE, rendering will happen in the front buffer even
304
 
  if the current rendering mode is double buffered.
305
 
*/
306
 
 
307
 
/*!
308
 
  \fn QWidget * SoQtGLWidget::getNormalWidget(void) const
309
 
 
310
 
  \if SOQT_DOC
311
 
  For SoQt, this returns the same widget pointer as that of
312
 
  SoQtGLWidget::getGLWidget().
313
 
  \endif
314
 
*/
315
 
 
316
 
/*!
317
 
  \fn QWidget * SoQtGLWidget::getOverlayWidget(void) const
318
 
 
319
 
  Returns widget associated with overlay planes, or \c NULL if no
320
 
  overlay planes are available.
321
 
 
322
 
  \if SOQT_DOC
323
 
  For the Qt toolkit, overlay planes is a feature of the QGLWidget,
324
 
  and not seen at a separate widget entity. So this call will just
325
 
  return the same widget reference as the SoQt::getGLWidget() call (if
326
 
  overlay planes are supported).
327
 
  \endif
328
 
*/
329
 
 
330
 
/*!
331
 
  \fn void SoQtGLWidget::setGLSize(const SbVec2s size)
332
 
  Sets the size of the GL canvas.
333
 
*/
334
 
 
335
 
/*!
336
 
  \fn SbVec2s SoQtGLWidget::getGLSize(void) const
337
 
 
338
 
  Return the dimensions of the OpenGL canvas.
339
 
*/
340
 
 
341
 
/*!
342
 
  \fn float SoQtGLWidget::getGLAspectRatio(void) const
343
 
 
344
 
  Return the aspect ratio of the OpenGL canvas.
345
 
*/
346
 
 
347
 
/*!
348
 
  \fn void SoQtGLWidget::setGlxSize(const SbVec2s size)
349
 
  This function has been renamed to the more appropriate setGLSize.
350
 
  \sa setGLSize
351
 
*/
352
 
 
353
 
/*!
354
 
  \fn SbVec2s SoQtGLWidget::getGlxSize(void) const
355
 
  This function has been renamed to the more appropriate getGLSize.
356
 
  \sa getGLSize
357
 
*/
358
 
 
359
 
/*!
360
 
  \fn float SoQtGLWidget::getGlxAspectRatio(void) const
361
 
  This function has been renamed to the more appropriate getGLAspectRatio.
362
 
  \sa getGLAspectRatio
363
 
*/
364
 
 
365
 
/*!
366
 
  \fn QWidget * SoQtGLWidget::getGLWidget(void) const
367
 
 
368
 
  Returns a pointer to the toolkit-native GL widget.
369
 
*/
370
 
 
371
 
/*!
372
 
  \fn void SoQtGLWidget::widgetChanged(QWidget * w)
373
 
 
374
 
  This is the method which gets called whenever we change which OpenGL
375
 
  widget is used.
376
 
 
377
 
  Should be overridden in subclasses which directly or indirectly
378
 
  store the return value from the SoQtGLWidget::getGLWidget()
379
 
  method.
380
 
 
381
 
  \sa sizeChanged()
382
 
*/
383
 
 
384
 
/*!
385
 
  \fn void SoQtGLWidget::processEvent(QEvent * anyevent)
386
 
 
387
 
  Any events from the native window system that goes to the OpenGL
388
 
  canvas gets piped through this method.
389
 
 
390
 
  It is overridden in the subclasses to catch user interaction with
391
 
  the render canvas in the viewers, aswell as forwarding relevant
392
 
  events to the scenegraph.
393
 
*/
394
 
 
395
 
/*!
396
 
  \fn void SoQtGLWidget::glLockNormal(void)
397
 
 
398
 
  This method calls make-current on the correct context and ups the
399
 
  lock level.
400
 
*/
401
 
 
402
 
/*!
403
 
  \fn void SoQtGLWidget::glUnlockNormal(void)
404
 
 
405
 
  This method drops the lock level.
406
 
*/
407
 
 
408
 
/*!
409
 
  \fn void SoQtGLWidget::glSwapBuffers(void)
410
 
  Swap back buffer to front and vice versa.
411
 
*/
412
 
 
413
 
/*!
414
 
  \fn void SoQtGLWidget::glFlushBuffer(void)
415
 
 
416
 
  Flush the current GL buffer. Simply calls glFlush().
417
 
*/
418
 
 
419
 
/*!
420
 
  \fn void SoQtGLWidget::glLockOverlay(void)
421
 
 
422
 
  This method calls make-current on the correct context and ups the
423
 
  lock level.
424
 
*/
425
 
 
426
 
/*!
427
 
  \fn void SoQtGLWidget::glUnlockOverlay(void)
428
 
 
429
 
  This method drops the lock level.
430
 
*/
431
 
 
432
 
/*!
433
 
  \fn unsigned long SoQtGLWidget::getOverlayTransparentPixel(void)
434
 
  Returns the overlay transparent pixel.
435
 
*/
436
 
 
437
 
/*!
438
 
  \fn SbBool SoQtGLWidget::isRGBMode(void)
439
 
 
440
 
  Returns \c TRUE if the normal GL context is in RGBA mode.
441
 
  Return \c FALSE if color index mode is used.
442
 
*/
443
 
 
444
 
/*!
445
 
  \fn void SoQtGLWidget::redrawOverlay(void)
446
 
 
447
 
  Renders the overlay scene graph. Default method is empty. Subclasses
448
 
  should override this method.
449
 
*/
450
 
 
451
 
/*!
452
 
  \fn SbBool SoQtGLWidget::hasNormalGLArea(void) const 
453
 
 
454
 
  Will return \c TRUE if a normal GL drawing area exists.
455
 
*/
456
 
 
457
 
/*!
458
 
  \fn SbBool SoQtGLWidget::hasOverlayGLArea(void) const 
459
 
 
460
 
  Will return \c TRUE if an overlay GL drawing area exists.
461
 
*/
462
 
 
463
 
/*!
464
 
  \fn void SoQtGLWidget::initGraphic(void)
465
 
 
466
 
  Will be called when GL widget should initialize graphic, after
467
 
  the widget has been created. Default method enabled GL_DEPTH_TEST.
468
 
*/
469
 
 
470
 
/*!
471
 
  \fn void SoQtGLWidget::initOverlayGraphic(void)
472
 
 
473
 
  Will be called after the overlay widget has been created, and subclasses
474
 
  should override this to initialize overlay stuff.
475
 
 
476
 
  Default method does nothing.
477
 
*/
478
 
 
479
 
/*!
480
 
  \fn SbBool SoQtGLWidget::glScheduleRedraw(void)
481
 
 
482
 
  Will be called whenever scene graph needs to be redrawn.  If this
483
 
  method return \c FALSE, redraw() will be called immediately.
484
 
 
485
 
  Default method simply returns \c FALSE. Override this method to
486
 
  schedule a redraw and return \c TRUE if you're trying to do The
487
 
  Right Thing.
488
 
*/
489
 
 
490
 
/*!
491
 
  \fn void SoQtGLWidget::setStealFocus(SbBool enable)
492
 
 
493
 
  Sets whether the GL widget should steal keyboard focus when the
494
 
  mouse is over the GL view.
495
 
 
496
 
  Default is \c TRUE.
497
 
 
498
 
  \sa isStealFocus
499
 
  \since SoQt 1.3.0
500
 
*/
501
 
 
502
 
/*!
503
 
  \fn SbBool SoQtGLWidget::isStealFocus(void) const
504
 
 
505
 
  Returns whether focus stealing policy is on (\c TRUE) or off (\c
506
 
  FALSE).
507
 
 
508
 
  Default is \c TRUE.
509
 
 
510
 
  \sa setStealFocus
511
 
  \since SoQt 1.3.0
512
 
*/
513
 
 
514
 
// Documented in common/SoGuiGLWidgetCommon.cpp.in.
515
 
void
516
 
SoQtGLWidget::setStealFocus(SbBool enable)
517
 
{
518
 
  PRIVATE(this)->stealFocus = enable;
519
 
}
520
 
 
521
 
// Documented in common/SoGuiGLWidgetCommon.cpp.in.
522
 
SbBool
523
 
SoQtGLWidget::isStealFocus(void) const
524
 
{
525
 
  return PRIVATE(this)->stealFocus;
526
 
}
527
 
 
528
 
// *************************************************************************
529
 
 
530
 
/*!
531
 
  This function is provided as a convenience for the application
532
 
  programmer to help with acquiring the OpenGL implementation limits
533
 
  for rendering points.
534
 
 
535
 
  For robust application code, one needs to consider the range limits
536
 
  when setting the SoDrawStyle::pointSize field.
537
 
*/
538
 
void
539
 
SoQtGLWidget::getPointSizeLimits(SbVec2f & range, float & granularity)
540
 
{
541
 
  this->glLockNormal();
542
 
 
543
 
  GLfloat vals[2];
544
 
  glGetFloatv(GL_POINT_SIZE_RANGE, vals);
545
 
 
546
 
  // Matthias Koenig reported on coin-discuss that the OpenGL
547
 
  // implementation on SGI Onyx 2 InfiniteReality returns 0 for the
548
 
  // lowest pointsize, but it will still set the return value of
549
 
  // glGetError() to GL_INVALID_VALUE if this size is attempted
550
 
  // used. So the boundary range fix in the next line of code is a
551
 
  // workaround for that OpenGL implementation bug.
552
 
  //
553
 
  // 0.0f and lower values are explicitly disallowed, according to
554
 
  // the OpenGL 1.3 specification, Chapter 3.3.
555
 
 
556
 
  if (vals[0] <= 0.0f) { vals[0] = SoQtMin(1.0f, vals[1]); }
557
 
 
558
 
  range.setValue(vals[0], vals[1]);
559
 
 
560
 
  GLfloat gran[1];
561
 
  glGetFloatv(GL_POINT_SIZE_GRANULARITY, gran);
562
 
  granularity = gran[0];
563
 
 
564
 
  this->glUnlockNormal();
565
 
}
566
 
 
567
 
/*!
568
 
  This function is provided as a convenience for the application
569
 
  programmer to help with acquiring the OpenGL implementation limits
570
 
  for rendering lines.
571
 
 
572
 
  For robust application code, one needs to consider the range limits
573
 
  when setting the SoDrawStyle::lineWidth field.
574
 
*/
575
 
void
576
 
SoQtGLWidget::getLineWidthLimits(SbVec2f & range, float & granularity)
577
 
{
578
 
  this->glLockNormal();
579
 
 
580
 
  GLfloat vals[2];
581
 
  glGetFloatv(GL_LINE_WIDTH_RANGE, vals);
582
 
 
583
 
  // Matthias Koenig reported on coin-discuss that the OpenGL
584
 
  // implementation on SGI Onyx 2 InfiniteReality returns 0 for the
585
 
  // lowest linewidth, but it will still set the return value of
586
 
  // glGetError() to GL_INVALID_VALUE if this size is attempted
587
 
  // used. This is a workaround for what looks like an OpenGL bug.
588
 
 
589
 
  if (vals[0] <= 0.0f) { vals[0] = SoQtMin(1.0f, vals[1]); }
590
 
 
591
 
  range.setValue(vals[0], vals[1]);
592
 
 
593
 
  GLfloat gran[1];
594
 
  glGetFloatv(GL_LINE_WIDTH_GRANULARITY, gran);
595
 
  granularity = gran[0];
596
 
 
597
 
  this->glUnlockNormal();
598
 
}
599
 
 
600
 
// FIXME: other implementation specifics to check are
601
 
//
602
 
//  * maximum stack depths (attribute, modelview matrix, name,
603
 
//    projection matrix, texture matrix)
604
 
//
605
 
//  * max display list nesting
606
 
//
607
 
//  * max nr of clipplanes
608
 
//
609
 
//  * max nr of light sources
610
 
//
611
 
//  * max 3D texture size (needs specific extension?)
612
 
//
613
 
// 20020802 mortene.
614
 
 
615
 
/*!
616
 
  Sets whether OpenGL stereo buffers (quad buffer stereo) should be
617
 
  used.
618
 
*/
619
 
void
620
 
SoQtGLWidget::setStereoBuffer(SbBool flag)
621
 
{
622
 
  // FIXME: is this really correct? 20011012 mortene.
623
 
  this->setQuadBufferStereo(flag);
624
 
}
625
 
 
626
 
/*!
627
 
  Returns whether OpenGL stereo buffers are being used.
628
 
*/
629
 
SbBool
630
 
SoQtGLWidget::isStereoBuffer(void) const
631
 
{
632
 
  // FIXME: is this really correct? 20011012 mortene.
633
 
  return this->isQuadBufferStereo();
634
 
}
635
 
 
636
 
// *************************************************************************
637
 
 
638
 
#ifndef DOXYGEN_SKIP_THIS
639
 
 
640
 
// Remaining code is for the SoGuiGLWidgetP "private implementation"
641
 
// class.
642
 
 
643
 
 
644
 
SoGuiGLWidgetP::SoGuiGLWidgetP(SoQtGLWidget * publ)
645
 
{
646
 
  this->pub = publ;
647
 
  this->stealFocus = TRUE;
648
 
}
649
 
 
650
 
SoGuiGLWidgetP::~SoGuiGLWidgetP()
651
 
{
652
 
}
653
 
 
654
 
// Just forward from a static function, so we can find out from
655
 
// anywhere within the library -- without exposing the API for the app
656
 
// programmer.
657
 
SbBool
658
 
SoGuiGLWidgetP::isDirectRendering(SoQtGLWidget * w)
659
 
{
660
 
  return ((SoGuiGLWidgetP *)(w->pimpl))->isDirectRendering();
661
 
}
662
 
 
663
 
#undef PRIVATE
664
 
#endif // DOXYGEN_SKIP_THIS
665
 
 
666
 
// *************************************************************************