diff options
Diffstat (limited to 'src/opengl/tqgl.cpp')
| -rw-r--r-- | src/opengl/tqgl.cpp | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/src/opengl/tqgl.cpp b/src/opengl/tqgl.cpp index 4ec6dec30..dab303c17 100644 --- a/src/opengl/tqgl.cpp +++ b/src/opengl/tqgl.cpp @@ -135,8 +135,8 @@ static TQCleanupHandler<TQGLFormat> qgl_cleanup_format; default for the entire application: \code TQGLFormat f; - f.setAlpha( TRUE ); - f.setStereo( TRUE ); + f.setAlpha( true ); + f.setStereo( true ); TQGLFormat::setDefaultFormat( f ); \endcode @@ -144,8 +144,8 @@ static TQCleanupHandler<TQGLFormat> qgl_cleanup_format; your TQGLWidget subclass: \code TQGLFormat f; - f.setDoubleBuffer( FALSE ); // single buffer - f.setDirectRendering( FALSE ); // software rendering + f.setDoubleBuffer( false ); // single buffer + f.setDirectRendering( false ); // software rendering MyGLWidget* myWidget = new MyGLWidget( f, ... ); \endcode @@ -153,8 +153,8 @@ static TQCleanupHandler<TQGLFormat> qgl_cleanup_format; requested features the system was able to provide: \code TQGLFormat f; - f.setOverlay( TRUE ); - f.setStereo( TRUE ); + f.setOverlay( true ); + f.setStereo( true ); MyGLWidget* myWidget = new MyGLWidget( f, ... ); if ( !w->format().stereo() ) { // ok, goggles off @@ -242,14 +242,14 @@ TQGLFormat::TQGLFormat( int options, int plane ) /*! \fn bool TQGLFormat::doubleBuffer() const - Returns TRUE if double buffering is enabled; otherwise returns - FALSE. Double buffering is enabled by default. + Returns true if double buffering is enabled; otherwise returns + false. Double buffering is enabled by default. \sa setDoubleBuffer() */ /*! - If \a enable is TRUE sets double buffering; otherwise sets single + If \a enable is true sets double buffering; otherwise sets single buffering. Double buffering is enabled by default. @@ -273,14 +273,14 @@ void TQGLFormat::setDoubleBuffer( bool enable ) /*! \fn bool TQGLFormat::depth() const - Returns TRUE if the depth buffer is enabled; otherwise returns - FALSE. The depth buffer is enabled by default. + Returns true if the depth buffer is enabled; otherwise returns + false. The depth buffer is enabled by default. \sa setDepth() */ /*! - If \a enable is TRUE enables the depth buffer; otherwise disables + If \a enable is true enables the depth buffer; otherwise disables the depth buffer. The depth buffer is enabled by default. @@ -303,14 +303,14 @@ void TQGLFormat::setDepth( bool enable ) /*! \fn bool TQGLFormat::rgba() const - Returns TRUE if RGBA color mode is set. Returns FALSE if color + Returns true if RGBA color mode is set. Returns false if color index mode is set. The default color mode is RGBA. \sa setRgba() */ /*! - If \a enable is TRUE sets RGBA mode. If \a enable is FALSE sets + If \a enable is true sets RGBA mode. If \a enable is false sets color index mode. The default color mode is RGBA. @@ -334,14 +334,14 @@ void TQGLFormat::setRgba( bool enable ) /*! \fn bool TQGLFormat::alpha() const - Returns TRUE if the alpha channel of the framebuffer is enabled; - otherwise returns FALSE. The alpha channel is disabled by default. + Returns true if the alpha channel of the framebuffer is enabled; + otherwise returns false. The alpha channel is disabled by default. \sa setAlpha() */ /*! - If \a enable is TRUE enables the alpha channel; otherwise disables + If \a enable is true enables the alpha channel; otherwise disables the alpha channel. The alpha buffer is disabled by default. @@ -362,14 +362,14 @@ void TQGLFormat::setAlpha( bool enable ) /*! \fn bool TQGLFormat::accum() const - Returns TRUE if the accumulation buffer is enabled; otherwise - returns FALSE. The accumulation buffer is disabled by default. + Returns true if the accumulation buffer is enabled; otherwise + returns false. The accumulation buffer is disabled by default. \sa setAccum() */ /*! - If \a enable is TRUE enables the accumulation buffer; otherwise + If \a enable is true enables the accumulation buffer; otherwise disables the accumulation buffer. The accumulation buffer is disabled by default. @@ -389,14 +389,14 @@ void TQGLFormat::setAccum( bool enable ) /*! \fn bool TQGLFormat::stencil() const - Returns TRUE if the stencil buffer is enabled; otherwise returns - FALSE. The stencil buffer is disabled by default. + Returns true if the stencil buffer is enabled; otherwise returns + false. The stencil buffer is disabled by default. \sa setStencil() */ /*! - If \a enable is TRUE enables the stencil buffer; otherwise + If \a enable is true enables the stencil buffer; otherwise disables the stencil buffer. The stencil buffer is disabled by default. @@ -416,14 +416,14 @@ void TQGLFormat::setStencil( bool enable ) /*! \fn bool TQGLFormat::stereo() const - Returns TRUE if stereo buffering is enabled; otherwise returns - FALSE. Stereo buffering is disabled by default. + Returns true if stereo buffering is enabled; otherwise returns + false. Stereo buffering is disabled by default. \sa setStereo() */ /*! - If \a enable is TRUE enables stereo buffering; otherwise disables + If \a enable is true enables stereo buffering; otherwise disables stereo buffering. Stereo buffering is disabled by default. @@ -443,8 +443,8 @@ void TQGLFormat::setStereo( bool enable ) /*! \fn bool TQGLFormat::directRendering() const - Returns TRUE if direct rendering is enabled; otherwise returns - FALSE. + Returns true if direct rendering is enabled; otherwise returns + false. Direct rendering is enabled by default. @@ -452,7 +452,7 @@ void TQGLFormat::setStereo( bool enable ) */ /*! - If \a enable is TRUE enables direct rendering; otherwise disables + If \a enable is true enables direct rendering; otherwise disables direct rendering. Direct rendering is enabled by default. @@ -473,7 +473,7 @@ void TQGLFormat::setDirectRendering( bool enable ) /*! \fn bool TQGLFormat::hasOverlay() const - Returns TRUE if overlay plane is enabled; otherwise returns FALSE. + Returns true if overlay plane is enabled; otherwise returns false. Overlay is disabled by default. @@ -481,7 +481,7 @@ void TQGLFormat::setDirectRendering( bool enable ) */ /*! - If \a enable is TRUE enables an overlay plane; otherwise disables + If \a enable is true enables an overlay plane; otherwise disables the overlay plane. Enabling the overlay plane will cause TQGLWidget to create an @@ -543,7 +543,7 @@ void TQGLFormat::setOption( FormatOption opt ) /*! - Returns TRUE if format option \a opt is set; otherwise returns FALSE. + Returns true if format option \a opt is set; otherwise returns false. \sa setOption() */ @@ -561,8 +561,8 @@ bool TQGLFormat::testOption( FormatOption opt ) const /*! \fn bool TQGLFormat::hasOpenGL() - Returns TRUE if the window system has any OpenGL support; - otherwise returns FALSE. + Returns true if the window system has any OpenGL support; + otherwise returns false. \warning This function must not be called until the TQApplication object has been created. @@ -573,8 +573,8 @@ bool TQGLFormat::testOption( FormatOption opt ) const /*! \fn bool TQGLFormat::hasOpenGLOverlays() - Returns TRUE if the window system supports OpenGL overlays; - otherwise returns FALSE. + Returns true if the window system supports OpenGL overlays; + otherwise returns false. \warning This function must not be called until the TQApplication object has been created. @@ -608,7 +608,7 @@ TQGLFormat TQGLFormat::defaultFormat() \code TQApplication a(argc, argv); TQGLFormat f; - f.setDoubleBuffer( FALSE ); + f.setDoubleBuffer( false ); TQGLFormat::setDefaultFormat( f ); \endcode @@ -666,7 +666,7 @@ TQGLFormat TQGLFormat::defaultOverlayFormat() \code TQGLFormat f = TQGLFormat::defaultOverlayFormat(); - f.setDoubleBuffer( TRUE ); + f.setDoubleBuffer( true ); TQGLFormat::setDefaultOverlayFormat( f ); \endcode @@ -700,13 +700,13 @@ void TQGLFormat::setDefaultOverlayFormat( const TQGLFormat &f ) // Make sure the user doesn't request that the overlays themselves // have overlays, since it is unlikely that the system supports // infinitely many planes... - qgl_default_overlay_format->setOverlay( FALSE ); + qgl_default_overlay_format->setOverlay( false ); } /*! - Returns TRUE if all the options of the two TQGLFormats are equal; - otherwise returns FALSE. + Returns true if all the options of the two TQGLFormats are equal; + otherwise returns false. */ bool operator==( const TQGLFormat& a, const TQGLFormat& b ) @@ -716,8 +716,8 @@ bool operator==( const TQGLFormat& a, const TQGLFormat& b ) /*! - Returns FALSE if all the options of the two TQGLFormats are equal; - otherwise returns TRUE. + Returns false if all the options of the two TQGLFormats are equal; + otherwise returns true. */ bool operator!=( const TQGLFormat& a, const TQGLFormat& b ) @@ -849,7 +849,7 @@ TQGLContext::~TQGLContext() TQGLContext *cx; // ... TQGLFormat f; - f.setStereo( TRUE ); + f.setStereo( true ); cx->setFormat( f ); if ( !cx->create() ) exit(); // no OpenGL support, or cannot render on the specified paintdevice @@ -885,7 +885,7 @@ void TQGLContext::setDevice( TQPaintDevice *pDev ) void TQGLContext::init( TQPaintDevice *dev ) { d = new Private; - d->valid = FALSE; + d->valid = false; #if defined(TQ_WS_X11) qt_resolve_gl_symbols(); gpm = 0; @@ -900,16 +900,16 @@ void TQGLContext::init( TQPaintDevice *dev ) #if defined(TQ_WS_MAC) d->oldR = TQRect(1, 1, 1, 1); #endif - d->crWin = FALSE; - d->initDone = FALSE; - d->sharing = FALSE; + d->crWin = false; + d->initDone = false; + d->sharing = false; } /*! \fn bool TQGLContext::isValid() const - Returns TRUE if a GL rendering context has been successfully - created; otherwise returns FALSE. + Returns true if a GL rendering context has been successfully + created; otherwise returns false. */ /*! @@ -922,9 +922,9 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! \fn bool TQGLContext::isSharing() const - Returns TRUE if display list sharing with another context was + Returns true if display list sharing with another context was requested in the create() call and the GL system was able to - fulfill this request; otherwise returns FALSE. Note that display + fulfill this request; otherwise returns false. Note that display list sharing might not be supported between contexts with different formats. */ @@ -932,15 +932,15 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! \fn bool TQGLContext::deviceIsPixmap() const - Returns TRUE if the paint device of this context is a pixmap; - otherwise returns FALSE. + Returns true if the paint device of this context is a pixmap; + otherwise returns false. */ /*! \fn bool TQGLContext::windowCreated() const - Returns TRUE if a window has been created for this context; - otherwise returns FALSE. + Returns true if a window has been created for this context; + otherwise returns false. \sa setWindowCreated() */ @@ -948,8 +948,8 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! \fn void TQGLContext::setWindowCreated( bool on ) - If \a on is TRUE the context has had a window created for it. If - \a on is FALSE no window has been created for the context. + If \a on is true the context has had a window created for it. If + \a on is false no window has been created for the context. \sa windowCreated() */ @@ -967,9 +967,9 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! \fn bool TQGLContext::initialized() const - Returns TRUE if this context has been initialized, i.e. if + Returns true if this context has been initialized, i.e. if TQGLWidget::initializeGL() has been performed on it; otherwise - returns FALSE. + returns false. \sa setInitialized() */ @@ -977,9 +977,9 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! \fn void TQGLContext::setInitialized( bool on ) - If \a on is TRUE the context has been initialized, i.e. + If \a on is true the context has been initialized, i.e. TQGLContext::setInitialized() has been called on it. If \a on is - FALSE the context has not been initialized. + false the context has not been initialized. \sa initialized() */ @@ -1014,9 +1014,9 @@ void TQGLContext::init( TQPaintDevice *dev ) /*! - Creates the GL context. Returns TRUE if it was successful in + Creates the GL context. Returns true if it was successful in creating a valid GL rendering context on the paint device - specified in the constructor; otherwise returns FALSE (i.e. the + specified in the constructor; otherwise returns false (i.e. the context is invalid). After successful creation, format() returns the set of features of @@ -1275,7 +1275,7 @@ static TQGLWidgetPrivate * qgl_d( const TQGLWidget * w ) if ( !qgl_d_ptr ) { qgl_d_ptr = new TQPtrDict<TQGLWidgetPrivate>; qgl_cleanup_d_ptr.set( &qgl_d_ptr ); - qgl_d_ptr->setAutoDelete( TRUE ); + qgl_d_ptr->setAutoDelete( true ); } TQGLWidgetPrivate * ret = qgl_d_ptr->find( (void *) w ); if ( !ret ) { @@ -1430,8 +1430,8 @@ TQGLWidget::~TQGLWidget() /*! \fn bool TQGLWidget::doubleBuffer() const - Returns TRUE if the contained GL rendering context has double - buffering; otherwise returns FALSE. + Returns true if the contained GL rendering context has double + buffering; otherwise returns false. \sa TQGLFormat::doubleBuffer() */ @@ -1439,10 +1439,10 @@ TQGLWidget::~TQGLWidget() /*! \fn void TQGLWidget::setAutoBufferSwap( bool on ) - If \a on is TRUE automatic GL buffer swapping is switched on; + If \a on is true automatic GL buffer swapping is switched on; otherwise it is switched off. - If \a on is TRUE and the widget is using a double-buffered format, + If \a on is true and the widget is using a double-buffered format, the background and foreground GL buffers will automatically be swapped after each paintGL() call. @@ -1454,8 +1454,8 @@ TQGLWidget::~TQGLWidget() /*! \fn bool TQGLWidget::autoBufferSwap() const - Returns TRUE if the widget is doing automatic GL buffer swapping; - otherwise returns FALSE. + Returns true if the widget is doing automatic GL buffer swapping; + otherwise returns false. \sa setAutoBufferSwap() */ @@ -1463,8 +1463,8 @@ TQGLWidget::~TQGLWidget() /*! \fn bool TQGLWidget::isValid() const - Returns TRUE if the widget has a valid GL rendering context; - otherwise returns FALSE. A widget will be invalid if the system + Returns true if the widget has a valid GL rendering context; + otherwise returns false. A widget will be invalid if the system has no \link TQGLFormat::hasOpenGL() OpenGL support\endlink. */ @@ -1476,9 +1476,9 @@ bool TQGLWidget::isValid() const /*! \fn bool TQGLWidget::isSharing() const - Returns TRUE if display list sharing with another TQGLWidget was + Returns true if display list sharing with another TQGLWidget was requested in the constructor, and the GL system was able to - provide it; otherwise returns FALSE. The GL system may fail to + provide it; otherwise returns false. The GL system may fail to provide display list sharing if the two TQGLWidgets use different formats. @@ -1625,8 +1625,8 @@ void TQGLWidget::setFormat( const TQGLFormat &format ) list sharing with that context, but it may fail. Use isSharing() to test. - If \a deleteOldContext is TRUE (the default), the existing context - will be deleted. You may use FALSE here if you have kept a pointer + If \a deleteOldContext is true (the default), the existing context + will be deleted. You may use false here if you have kept a pointer to the old context (as returned by context()), and want to restore that context later. @@ -1803,9 +1803,9 @@ void TQGLWidget::paintEvent( TQPaintEvent * ) high unless one of these parameters is 0 (the default), in which case the pixmap will have the same size as the widget. - If \a useContext is TRUE, this method will try to be more + If \a useContext is true, this method will try to be more efficient by using the existing GL context to render the pixmap. - The default is FALSE. Only use TRUE if you understand the risks. + The default is false. Only use true if you understand the risks. Overlays are not rendered onto the pixmap. @@ -1830,7 +1830,7 @@ TQPixmap TQGLWidget::renderPixmap( int w, int h, bool useContext ) // make sure the pixmap uses the same visual as the widget itself if ( needConversion ) { - TQPaintDeviceX11Data* xd = pm.getX11Data( TRUE ); + TQPaintDeviceX11Data* xd = pm.getX11Data( true ); xd->x_depth = x11Depth(); xd->x_visual = (Visual *) x11Visual(); pm.setX11Data( xd ); @@ -1842,14 +1842,14 @@ TQPixmap TQGLWidget::renderPixmap( int w, int h, bool useContext ) glcx->doneCurrent(); - bool success = TRUE; + bool success = true; if ( useContext && isValid() && renderCxPm( &pm ) ) return pm; TQGLFormat fmt = glcx->requestedFormat(); - fmt.setDirectRendering( FALSE ); // Direct is unlikely to work - fmt.setDoubleBuffer( FALSE ); // We don't need dbl buf + fmt.setDirectRendering( false ); // Direct is unlikely to work + fmt.setDoubleBuffer( false ); // We don't need dbl buf TQGLContext* ocx = glcx; bool wasCurrent = (TQGLContext::currentContext() == ocx ); @@ -1860,7 +1860,7 @@ TQPixmap TQGLWidget::renderPixmap( int w, int h, bool useContext ) if ( glcx->isValid() ) updateGL(); else - success = FALSE; + success = false; delete glcx; glcx = ocx; @@ -1885,7 +1885,7 @@ TQPixmap TQGLWidget::renderPixmap( int w, int h, bool useContext ) /*! - Returns an image of the frame buffer. If \a withAlpha is TRUE the + Returns an image of the frame buffer. If \a withAlpha is true the alpha channel is included. Depending on your hardware, you can explicitly select which color @@ -1895,7 +1895,7 @@ TQPixmap TQGLWidget::renderPixmap( int w, int h, bool useContext ) TQImage TQGLWidget::grabFrameBuffer( bool withAlpha ) { #if defined( TQ_WS_MAC ) - if(dblbuf == macInternalDoubleBuffer(FALSE) && gl_pix) //why not optimize? + if(dblbuf == macInternalDoubleBuffer(false) && gl_pix) //why not optimize? return ((TQPixmap*)gl_pix)->convertToImage(); #endif makeCurrent(); @@ -1958,7 +1958,7 @@ void TQGLWidget::glInit() return; makeCurrent(); initializeGL(); - glcx->setInitialized( TRUE ); + glcx->setInitialized( true ); } |
