diff options
Diffstat (limited to 'src/opengl/qgl_x11.cpp')
| -rw-r--r-- | src/opengl/qgl_x11.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
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 ) |
