summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/ntqgl.h12
-rw-r--r--src/opengl/qgl.cpp174
-rw-r--r--src/opengl/qgl_x11.cpp126
-rw-r--r--src/opengl/qgl_x11_p.h4
-rw-r--r--src/opengl/qglcolormap.cpp2
5 files changed, 159 insertions, 159 deletions
diff --git a/src/opengl/ntqgl.h b/src/opengl/ntqgl.h
index 858a96494..0949cae41 100644
--- a/src/opengl/ntqgl.h
+++ b/src/opengl/ntqgl.h
@@ -304,12 +304,12 @@ public:
#ifndef Q_QDOC
virtual void setContext( TQGLContext* context,
const TQGLContext* shareContext = 0,
- bool deleteOldContext = TRUE );
+ bool deleteOldContext = true );
#endif
virtual TQPixmap renderPixmap( int w = 0, int h = 0,
- bool useContext = FALSE );
- virtual TQImage grabFrameBuffer( bool withAlpha = FALSE );
+ bool useContext = false );
+ virtual TQImage grabFrameBuffer( bool withAlpha = false );
virtual void makeOverlayCurrent();
const TQGLContext* overlayContext() const;
@@ -318,7 +318,7 @@ public:
void setMouseTracking( bool enable );
virtual void reparent( TQWidget* parent, WFlags f, const TQPoint& p,
- bool showIt = FALSE );
+ bool showIt = false );
const TQGLColormap & colormap() const;
void setColormap( const TQGLColormap & map );
@@ -384,8 +384,8 @@ private:
void macInternalRecreateContext( TQGLContext *ctx,
const TQGLContext* = NULL,
- bool update = TRUE );
- bool macInternalDoubleBuffer( bool fix = TRUE );
+ bool update = true );
+ bool macInternalDoubleBuffer( bool fix = true );
virtual void setRegionDirty( bool );
virtual void macWidgetChangedWindow();
#endif
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 83b27a0c3..d1e0adb5f 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.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 );
}
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 724e999e4..25fdbd944 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -124,19 +124,19 @@ _glXWaitX qt_glXWaitX;
bool qt_resolve_gl_symbols(bool fatal)
{
- static bool gl_syms_resolved = FALSE;
+ static bool gl_syms_resolved = false;
if (gl_syms_resolved)
- return TRUE;
+ return true;
TQLibrary gl("GL.so.1");
- gl.setAutoUnload(FALSE);
+ gl.setAutoUnload(false);
qt_glCallLists = (_glCallLists) gl.resolve("glCallLists");
if (!qt_glCallLists) { // if this fails the rest will surely fail
if (fatal)
tqFatal("Unable to resolve GL/GLX symbols - please check your GL library installation.");
- return FALSE;
+ return false;
}
qt_glClearColor = (_glClearColor) gl.resolve("glClearColor");
@@ -181,8 +181,8 @@ bool qt_resolve_gl_symbols(bool fatal)
qt_glXSwapBuffers = (_glXSwapBuffers) gl.resolve("glXSwapBuffers");
qt_glXUseXFont = (_glXUseXFont) gl.resolve("glXUseXFont");
qt_glXWaitX = (_glXWaitX) gl.resolve("glXWaitX");
- gl_syms_resolved = TRUE;
- return TRUE;
+ gl_syms_resolved = true;
+ return true;
}
#endif // QT_DLOPEN_OPENGL
@@ -206,7 +206,7 @@ struct CMapEntry {
CMapEntry::CMapEntry()
{
cmap = 0;
- alloc = FALSE;
+ alloc = false;
scmap.colormap = 0;
}
@@ -217,18 +217,18 @@ CMapEntry::~CMapEntry()
}
static TQIntDict<CMapEntry> *cmap_dict = 0;
-static bool mesa_gl = FALSE;
+static bool mesa_gl = false;
static TQIntDict< TQMap<int, TQRgb> > *qglcmap_dict = 0;
static void cleanup_cmaps()
{
if (cmap_dict) {
- cmap_dict->setAutoDelete(TRUE);
+ cmap_dict->setAutoDelete(true);
delete cmap_dict;
cmap_dict = 0;
}
if (qglcmap_dict) {
- qglcmap_dict->setAutoDelete(TRUE);
+ qglcmap_dict->setAutoDelete(true);
delete qglcmap_dict;
qglcmap_dict = 0;
}
@@ -262,7 +262,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
}
if ( mesa_gl ) { // we're using MesaGL
- Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", TRUE );
+ Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
if ( hp_cmaps && vi->visual->c_class == TrueColor && vi->depth == 8 ) {
if ( XGetRGBColormaps(dpy,RootWindow(dpy,vi->screen),&c,&n,
hp_cmaps) ) {
@@ -294,7 +294,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
#endif
if ( XmuLookupStandardColormap(dpy,vi->screen,vi->visualid,vi->depth,
- XA_RGB_DEFAULT_MAP,FALSE,TRUE) ) {
+ XA_RGB_DEFAULT_MAP,false,true) ) {
if ( XGetRGBColormaps(dpy,RootWindow(dpy,vi->screen),&c,&n,
XA_RGB_DEFAULT_MAP) ) {
i = 0;
@@ -314,7 +314,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
if ( !x->cmap ) { // no shared cmap found
x->cmap = XCreateColormap( dpy, RootWindow(dpy,vi->screen), vi->visual,
AllocNone );
- x->alloc = TRUE;
+ x->alloc = true;
// tqDebug( "Allocating cmap" );
}
@@ -331,7 +331,7 @@ struct TransColor
};
static TQMemArray<TransColor> trans_colors;
-static int trans_colors_init = FALSE;
+static int trans_colors_init = false;
static void find_trans_colors()
@@ -343,7 +343,7 @@ static void find_trans_colors()
long layer;
};
- trans_colors_init = TRUE;
+ trans_colors_init = true;
Display* appDisplay = TQPaintDevice::x11AppDisplay();
@@ -397,8 +397,8 @@ static void find_trans_colors()
bool TQGLFormat::hasOpenGL()
{
- if (!qt_resolve_gl_symbols(FALSE))
- return FALSE;
+ if (!qt_resolve_gl_symbols(false))
+ return false;
return glXQueryExtension(tqt_xdisplay(),0,0) != 0;
}
@@ -422,7 +422,7 @@ bool TQGLContext::chooseContext( const TQGLContext* shareContext )
Display* disp = d->paintDevice->x11Display();
vi = chooseVisual();
if ( !vi )
- return FALSE;
+ return false;
if ( deviceIsPixmap() &&
(((XVisualInfo*)vi)->depth != d->paintDevice->x11Depth() ||
@@ -436,12 +436,12 @@ bool TQGLContext::chooseContext( const TQGLContext* shareContext )
int nvis;
vi = XGetVisualInfo( disp, VisualIDMask | VisualScreenMask, &appVisInfo, &nvis );
if ( !vi )
- return FALSE;
+ return false;
int useGL;
glXGetConfig( disp, (XVisualInfo*)vi, GLX_USE_GL, &useGL );
if ( !useGL )
- return FALSE; //# Chickening out already...
+ return false; //# Chickening out already...
}
int res;
glXGetConfig( disp, (XVisualInfo*)vi, GLX_LEVEL, &res );
@@ -484,12 +484,12 @@ bool TQGLContext::chooseContext( const TQGLContext* shareContext )
cx = glXCreateContext( disp, (XVisualInfo *)vi,
(GLXContext)shareContext->cx, direct );
if ( cx )
- d->sharing = TRUE;
+ d->sharing = true;
}
if ( !cx )
cx = glXCreateContext( disp, (XVisualInfo *)vi, None, direct );
if ( !cx )
- return FALSE;
+ return false;
glFormat.setDirectRendering( glXIsDirect( disp, (GLXContext)cx ) );
if ( deviceIsPixmap() ) {
#if defined(GLX_MESA_pixmap_colormap) && defined(TQGL_USE_MESA_EXT)
@@ -501,9 +501,9 @@ bool TQGLContext::chooseContext( const TQGLContext* shareContext )
d->paintDevice->handle() );
#endif
if ( !gpm )
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
@@ -525,50 +525,50 @@ void *TQGLContext::chooseVisual()
//todo: if pixmap, also make sure that vi->depth == pixmap->depth
void* vis = 0;
int i = 0;
- bool fail = FALSE;
+ bool fail = false;
TQGLFormat fmt = format();
bool tryDouble = !fmt.doubleBuffer(); // Some GL impl's only have double
- bool triedDouble = FALSE;
+ bool triedDouble = false;
while( !fail && !( vis = tryVisual( fmt, bufDepths[i] ) ) ) {
if ( !fmt.rgba() && bufDepths[i] > 1 ) {
i++;
continue;
}
if ( tryDouble ) {
- fmt.setDoubleBuffer( TRUE );
- tryDouble = FALSE;
- triedDouble = TRUE;
+ fmt.setDoubleBuffer( true );
+ tryDouble = false;
+ triedDouble = true;
continue;
}
else if ( triedDouble ) {
- fmt.setDoubleBuffer( FALSE );
- triedDouble = FALSE;
+ fmt.setDoubleBuffer( false );
+ triedDouble = false;
}
if ( fmt.stereo() ) {
- fmt.setStereo( FALSE );
+ fmt.setStereo( false );
continue;
}
if ( fmt.accum() ) {
- fmt.setAccum( FALSE );
+ fmt.setAccum( false );
continue;
}
if ( fmt.stencil() ) {
- fmt.setStencil( FALSE );
+ fmt.setStencil( false );
continue;
}
if ( fmt.alpha() ) {
- fmt.setAlpha( FALSE );
+ fmt.setAlpha( false );
continue;
}
if ( fmt.depth() ) {
- fmt.setDepth( FALSE );
+ fmt.setDepth( false );
continue;
}
if ( fmt.doubleBuffer() ) {
- fmt.setDoubleBuffer( FALSE );
+ fmt.setDoubleBuffer( false );
continue;
}
- fail = TRUE;
+ fail = true;
}
glFormat = fmt;
return vis;
@@ -594,8 +594,8 @@ void *TQGLContext::tryVisual( const TQGLFormat& f, int bufDepth )
spec[i++] = f.plane();
#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info)
- static bool useTranspExt = FALSE;
- static bool useTranspExtChecked = FALSE;
+ static bool useTranspExt = false;
+ static bool useTranspExtChecked = false;
if ( f.plane() && !useTranspExtChecked && d->paintDevice ) {
TQCString estr( glXQueryExtensionsString( d->paintDevice->x11Display(),
d->paintDevice->x11Screen() ) );
@@ -615,12 +615,12 @@ void *TQGLContext::tryVisual( const TQGLFormat& f, int bufDepth )
XVisualInfo * vinf = glXChooseVisual( d->paintDevice->x11Display(),
d->paintDevice->x11Screen(), tmpSpec );
if ( !vinf ) {
- useTranspExt = FALSE;
+ useTranspExt = false;
}
}
}
- useTranspExtChecked = TRUE;
+ useTranspExtChecked = true;
}
if ( f.plane() && useTranspExt ) {
// Required to avoid non-transparent overlay visual(!) on some systems
@@ -691,11 +691,11 @@ void TQGLContext::reset()
XFree( vi );
vi = 0;
cx = 0;
- d->crWin = FALSE;
- d->sharing = FALSE;
- d->valid = FALSE;
+ d->crWin = false;
+ d->sharing = false;
+ d->valid = false;
d->transpColor = TQColor();
- d->initDone = FALSE;
+ d->initDone = false;
}
@@ -707,7 +707,7 @@ void TQGLContext::makeCurrent()
#endif
return;
}
- bool ok = TRUE;
+ bool ok = true;
if ( deviceIsPixmap() )
ok = glXMakeCurrent( d->paintDevice->x11Display(),
(GLXPixmap)gpm,
@@ -816,7 +816,7 @@ uint TQGLContext::colorIndex( const TQColor& c ) const
// need to alloc color
unsigned long plane_mask[2];
unsigned long color_map_entry;
- if (!XAllocColorCells (TQPaintDevice::x11AppDisplay(), x->cmap, TRUE, plane_mask, 0,
+ if (!XAllocColorCells (TQPaintDevice::x11AppDisplay(), x->cmap, true, plane_mask, 0,
&color_map_entry, 1))
return c.pixel(screen);
@@ -1034,7 +1034,7 @@ void TQGLWidget::init( TQGLContext *context, const TQGLWidget *shareWidget )
glcx = 0;
olw = 0;
- autoSwap = TRUE;
+ autoSwap = true;
if ( !context->device() )
context->setDevice( this );
@@ -1050,13 +1050,13 @@ void TQGLWidget::init( TQGLContext *context, const TQGLWidget *shareWidget )
olw = new TQGLOverlayWidget( TQGLFormat::defaultOverlayFormat(),
this, olwName, shareWidget );
if ( olw->isValid() ) {
- olw->setAutoBufferSwap( FALSE );
+ olw->setAutoBufferSwap( false );
olw->setFocusProxy( this );
}
else {
delete olw;
olw = 0;
- glcx->glFormat.setOverlay( FALSE );
+ glcx->glFormat.setOverlay( false );
}
}
}
@@ -1067,7 +1067,7 @@ void TQGLWidget::reparent( TQWidget* parent, WFlags f, const TQPoint& p,
{
if (glcx)
glcx->doneCurrent();
- TQWidget::reparent( parent, f, p, FALSE );
+ TQWidget::reparent( parent, f, p, false );
if ( showIt )
show();
}
@@ -1138,10 +1138,10 @@ void TQGLWidget::setContext( TQGLContext *context,
TQGLContext* oldcx = glcx;
glcx = context;
- bool createFailed = FALSE;
+ bool createFailed = false;
if ( !glcx->isValid() ) {
if ( !glcx->create( shareContext ? shareContext : oldcx ) )
- createFailed = TRUE;
+ createFailed = true;
}
if ( createFailed ) {
if ( deleteOldContext )
@@ -1213,14 +1213,14 @@ void TQGLWidget::setContext( TQGLContext *context,
if ( visible )
show();
XFlush( x11Display() );
- glcx->setWindowCreated( TRUE );
+ glcx->setWindowCreated( true );
}
bool TQGLWidget::renderCxPm( TQPixmap* pm )
{
if ( ((XVisualInfo*)glcx->vi)->depth != pm->depth() )
- return FALSE;
+ return false;
GLXPixmap glPm;
#if defined(GLX_MESA_pixmap_colormap) && defined(TQGL_USE_MESA_EXT)
@@ -1237,7 +1237,7 @@ bool TQGLWidget::renderCxPm( TQPixmap* pm )
if ( !glXMakeCurrent( x11Display(), glPm, (GLXContext)glcx->cx ) ) {
glXDestroyGLXPixmap( x11Display(), glPm );
- return FALSE;
+ return false;
}
glDrawBuffer( GL_FRONT );
@@ -1249,7 +1249,7 @@ bool TQGLWidget::renderCxPm( TQPixmap* pm )
makeCurrent();
glXDestroyGLXPixmap( x11Display(), glPm );
resizeGL( width(), height() );
- return TRUE;
+ return true;
}
const TQGLColormap & TQGLWidget::colormap() const
@@ -1282,7 +1282,7 @@ static void qStoreColors( TQWidget * tlw, Colormap cmap,
*/
static bool qCanAllocColors( TQWidget * w )
{
- bool validVisual = FALSE;
+ bool validVisual = false;
int numVisuals;
long mask;
XVisualInfo templ;
@@ -1301,11 +1301,11 @@ static bool qCanAllocColors( TQWidget * w )
case StaticColor:
case StaticGray:
case GrayScale:
- validVisual = FALSE;
+ validVisual = false;
break;
case DirectColor:
case PseudoColor:
- validVisual = TRUE;
+ validVisual = true;
break;
}
break;
@@ -1314,8 +1314,8 @@ static bool qCanAllocColors( TQWidget * w )
XFree( visuals );
if ( !validVisual )
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
void TQGLWidget::setColormap( const TQGLColormap & c )
diff --git a/src/opengl/qgl_x11_p.h b/src/opengl/qgl_x11_p.h
index cbcd741b9..076d83b8d 100644
--- a/src/opengl/qgl_x11_p.h
+++ b/src/opengl/qgl_x11_p.h
@@ -52,7 +52,7 @@
#ifdef QT_DLOPEN_OPENGL
// resolve the GL symbols we use ourselves
-bool qt_resolve_gl_symbols(bool = TRUE);
+bool qt_resolve_gl_symbols(bool = true);
extern "C" {
// GL symbols
typedef void (*_glCallLists)( GLsizei n, GLenum type, const GLvoid *lists );
@@ -192,6 +192,6 @@ extern _glXWaitX qt_glXWaitX;
#define glXWaitX qt_glXWaitX
#else
-inline bool qt_resolve_gl_symbols(bool = TRUE) { return TRUE; }
+inline bool qt_resolve_gl_symbols(bool = true) { return true; }
#endif // QT_DLOPEN_OPENGL
#endif // TQGL_P_H
diff --git a/src/opengl/qglcolormap.cpp b/src/opengl/qglcolormap.cpp
index 541e309d6..76b7dcbba 100644
--- a/src/opengl/qglcolormap.cpp
+++ b/src/opengl/qglcolormap.cpp
@@ -234,7 +234,7 @@ TQColor TQGLColormap::entryColor( int idx ) const
}
/*!
- Returns TRUE if the colormap is empty; otherwise returns FALSE. A
+ Returns true if the colormap is empty; otherwise returns false. A
colormap with no color values set is considered to be empty.
*/
bool TQGLColormap::isEmpty() const