From bb45fec07460748f7762e709eeed8b7111c5a3c8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 2 Jun 2004 20:45:19 +0000 Subject: [PATCH] Minor changes to make it work better outside X. "Success" is replaced by explicit 0. Several functions that are not needed with DRI_NEW_INTERFACE_ONLY are blocked with '#ifndef DRI_NEW_INTERFACE_ONLY'. Some further work is still required to make it build without any X include files, though. --- src/mesa/drivers/dri/common/glcontextmodes.c | 80 ++++++++++---------- src/mesa/drivers/dri/common/glcontextmodes.h | 3 + 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index 784ad30259b..448c33d1874 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -48,6 +48,7 @@ extern void __glXFree( void * ptr ); #include "glcontextmodes.h" +#ifndef DRI_NEW_INTERFACE_ONLY #define NUM_VISUAL_TYPES 6 /** @@ -168,6 +169,7 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, mode->swapMethod = GLX_SWAP_UNDEFINED_OML; } +#endif /* DRI_NEW_INTERFACE_ONLY */ /** @@ -176,7 +178,7 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, * \param mode GL context mode whose data is to be returned. * \param attribute Attribute of \c mode that is to be returned. * \param value_return Location to store the data member of \c mode. - * \return If \c attribute is a valid attribute of \c mode, \c Success is + * \return If \c attribute is a valid attribute of \c mode, zero is * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. */ int @@ -186,118 +188,118 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, switch (attribute) { case GLX_USE_GL: *value_return = GL_TRUE; - return Success; + return 0; case GLX_BUFFER_SIZE: *value_return = mode->rgbBits; - return Success; + return 0; case GLX_RGBA: *value_return = mode->rgbMode; - return Success; + return 0; case GLX_RED_SIZE: *value_return = mode->redBits; - return Success; + return 0; case GLX_GREEN_SIZE: *value_return = mode->greenBits; - return Success; + return 0; case GLX_BLUE_SIZE: *value_return = mode->blueBits; - return Success; + return 0; case GLX_ALPHA_SIZE: *value_return = mode->alphaBits; - return Success; + return 0; case GLX_DOUBLEBUFFER: *value_return = mode->doubleBufferMode; - return Success; + return 0; case GLX_STEREO: *value_return = mode->stereoMode; - return Success; + return 0; case GLX_AUX_BUFFERS: *value_return = mode->numAuxBuffers; - return Success; + return 0; case GLX_DEPTH_SIZE: *value_return = mode->depthBits; - return Success; + return 0; case GLX_STENCIL_SIZE: *value_return = mode->stencilBits; - return Success; + return 0; case GLX_ACCUM_RED_SIZE: *value_return = mode->accumRedBits; - return Success; + return 0; case GLX_ACCUM_GREEN_SIZE: *value_return = mode->accumGreenBits; - return Success; + return 0; case GLX_ACCUM_BLUE_SIZE: *value_return = mode->accumBlueBits; - return Success; + return 0; case GLX_ACCUM_ALPHA_SIZE: *value_return = mode->accumAlphaBits; - return Success; + return 0; case GLX_LEVEL: *value_return = mode->level; - return Success; + return 0; case GLX_TRANSPARENT_TYPE_EXT: *value_return = mode->transparentPixel; - return Success; + return 0; case GLX_TRANSPARENT_RED_VALUE: *value_return = mode->transparentRed; - return Success; + return 0; case GLX_TRANSPARENT_GREEN_VALUE: *value_return = mode->transparentGreen; - return Success; + return 0; case GLX_TRANSPARENT_BLUE_VALUE: *value_return = mode->transparentBlue; - return Success; + return 0; case GLX_TRANSPARENT_ALPHA_VALUE: *value_return = mode->transparentAlpha; - return Success; + return 0; case GLX_TRANSPARENT_INDEX_VALUE: *value_return = mode->transparentIndex; - return Success; + return 0; case GLX_X_VISUAL_TYPE: *value_return = mode->visualType; - return Success; + return 0; case GLX_CONFIG_CAVEAT: *value_return = mode->visualRating; - return Success; + return 0; case GLX_VISUAL_ID: *value_return = mode->visualID; - return Success; + return 0; case GLX_DRAWABLE_TYPE: *value_return = mode->drawableType; - return Success; + return 0; case GLX_RENDER_TYPE: *value_return = mode->renderType; - return Success; + return 0; case GLX_X_RENDERABLE: *value_return = mode->xRenderable; - return Success; + return 0; case GLX_FBCONFIG_ID: *value_return = mode->fbconfigID; - return Success; + return 0; case GLX_MAX_PBUFFER_WIDTH: *value_return = mode->maxPbufferWidth; - return Success; + return 0; case GLX_MAX_PBUFFER_HEIGHT: *value_return = mode->maxPbufferHeight; - return Success; + return 0; case GLX_MAX_PBUFFER_PIXELS: *value_return = mode->maxPbufferPixels; - return Success; + return 0; case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: *value_return = mode->optimalPbufferWidth; - return Success; + return 0; case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: *value_return = mode->optimalPbufferHeight; - return Success; + return 0; case GLX_SWAP_METHOD_OML: *value_return = mode->swapMethod; - return Success; + return 0; case GLX_SAMPLE_BUFFERS_SGIS: *value_return = mode->sampleBuffers; - return Success; + return 0; case GLX_SAMPLES_SGIS: *value_return = mode->samples; - return Success; + return 0; /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. * It is ONLY for communication between the GLX client and the GLX diff --git a/src/mesa/drivers/dri/common/glcontextmodes.h b/src/mesa/drivers/dri/common/glcontextmodes.h index 5f8fa4f3116..8959e1d4ea9 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.h +++ b/src/mesa/drivers/dri/common/glcontextmodes.h @@ -32,10 +32,13 @@ #include "GL/internal/glcore.h" +#ifndef DRI_NEW_INTERFACE_ONLY extern GLint _gl_convert_from_x_visual_type( int visualType ); extern GLint _gl_convert_to_x_visual_type( int visualType ); extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode, const __GLXvisualConfig * config ); +#endif /* DRI_NEW_INTERFACE_ONLY */ + extern int _gl_get_context_mode_data( const __GLcontextModes *mode, int attribute, int *value_return ); extern __GLcontextModes * _gl_context_modes_create( unsigned count, -- 2.30.2