📄 glcontextmodes.c
字号:
*value_return = mode->level; return 0; case GLX_TRANSPARENT_TYPE_EXT: *value_return = mode->transparentPixel; return 0; case GLX_TRANSPARENT_RED_VALUE: *value_return = mode->transparentRed; return 0; case GLX_TRANSPARENT_GREEN_VALUE: *value_return = mode->transparentGreen; return 0; case GLX_TRANSPARENT_BLUE_VALUE: *value_return = mode->transparentBlue; return 0; case GLX_TRANSPARENT_ALPHA_VALUE: *value_return = mode->transparentAlpha; return 0; case GLX_TRANSPARENT_INDEX_VALUE: *value_return = mode->transparentIndex; return 0; case GLX_X_VISUAL_TYPE: *value_return = mode->visualType; return 0; case GLX_CONFIG_CAVEAT: *value_return = mode->visualRating; return 0; case GLX_VISUAL_ID: *value_return = mode->visualID; return 0; case GLX_DRAWABLE_TYPE: *value_return = mode->drawableType; return 0; case GLX_RENDER_TYPE: *value_return = mode->renderType; return 0; case GLX_X_RENDERABLE: *value_return = mode->xRenderable; return 0; case GLX_FBCONFIG_ID: *value_return = mode->fbconfigID; return 0; case GLX_MAX_PBUFFER_WIDTH: *value_return = mode->maxPbufferWidth; return 0; case GLX_MAX_PBUFFER_HEIGHT: *value_return = mode->maxPbufferHeight; return 0; case GLX_MAX_PBUFFER_PIXELS: *value_return = mode->maxPbufferPixels; return 0; case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: *value_return = mode->optimalPbufferWidth; return 0; case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: *value_return = mode->optimalPbufferHeight; return 0; case GLX_SWAP_METHOD_OML: *value_return = mode->swapMethod; return 0; case GLX_SAMPLE_BUFFERS_SGIS: *value_return = mode->sampleBuffers; return 0; case GLX_SAMPLES_SGIS: *value_return = mode->samples; 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 * server. */ case GLX_VISUAL_SELECT_GROUP_SGIX: default: return GLX_BAD_ATTRIBUTE; }}#endif /* !defined(IN_MINI_GLX) *//** * Allocate a linked list of \c __GLcontextModes structures. The fields of * each structure will be initialized to "reasonable" default values. In * most cases this is the default value defined by table 3.4 of the GLX * 1.3 specification. This means that most values are either initialized to * zero or \c GLX_DONT_CARE (which is -1). As support for additional * extensions is added, the new values will be initialized to appropriate * values from the extension specification. * * \param count Number of structures to allocate. * \param minimum_size Minimum size of a structure to allocate. This allows * for differences in the version of the * \c __GLcontextModes stucture used in libGL and in a * DRI-based driver. * \returns A pointer to the first element in a linked list of \c count * stuctures on success, or \c NULL on failure. * * \warning Use of \c minimum_size does \b not guarantee binary compatibility. * The fundamental assumption is that if the \c minimum_size * specified by the driver and the size of the \c __GLcontextModes * structure in libGL is the same, then the meaning of each byte in * the structure is the same in both places. \b Be \b careful! * Basically this means that fields have to be added in libGL and * then propagated to drivers. Drivers should \b never arbitrarilly * extend the \c __GLcontextModes data-structure. */__GLcontextModes *_gl_context_modes_create( unsigned count, size_t minimum_size ){ const size_t size = (minimum_size > sizeof( __GLcontextModes )) ? minimum_size : sizeof( __GLcontextModes ); __GLcontextModes * base = NULL; __GLcontextModes ** next; unsigned i; next = & base; for ( i = 0 ; i < count ; i++ ) { *next = (__GLcontextModes *) _mesa_malloc( size ); if ( *next == NULL ) { _gl_context_modes_destroy( base ); base = NULL; break; } (void) _mesa_memset( *next, 0, size ); (*next)->visualID = GLX_DONT_CARE; (*next)->visualType = GLX_DONT_CARE; (*next)->visualRating = GLX_NONE; (*next)->transparentPixel = GLX_NONE; (*next)->transparentRed = GLX_DONT_CARE; (*next)->transparentGreen = GLX_DONT_CARE; (*next)->transparentBlue = GLX_DONT_CARE; (*next)->transparentAlpha = GLX_DONT_CARE; (*next)->transparentIndex = GLX_DONT_CARE; (*next)->xRenderable = GLX_DONT_CARE; (*next)->fbconfigID = GLX_DONT_CARE; (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; next = & ((*next)->next); } return base;}/** * Destroy a linked list of \c __GLcontextModes structures created by * \c _gl_context_modes_create. * * \param modes Linked list of structures to be destroyed. All structres * in the list will be freed. */void_gl_context_modes_destroy( __GLcontextModes * modes ){ while ( modes != NULL ) { __GLcontextModes * const next = modes->next; _mesa_free( modes ); modes = next; }}/** * Find a context mode matching a Visual ID. * * \param modes List list of context-mode structures to be searched. * \param vid Visual ID to be found. * \returns A pointer to a context-mode in \c modes if \c vid was found in * the list, or \c NULL if it was not. */__GLcontextModes *_gl_context_modes_find_visual( __GLcontextModes * modes, int vid ){ while ( modes != NULL ) { if ( modes->visualID == vid ) { break; } modes = modes->next; } return modes;}/** * Determine if two context-modes are the same. This is intended to be used * by libGL implementations to compare to sets of driver generated FBconfigs. * * \param a Context-mode to be compared. * \param b Context-mode to be compared. * \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is * returned otherwise. */GLboolean_gl_context_modes_are_same( const __GLcontextModes * a, const __GLcontextModes * b ){ return( (a->rgbMode == b->rgbMode) && (a->floatMode == b->floatMode) && (a->colorIndexMode == b->colorIndexMode) && (a->doubleBufferMode == b->doubleBufferMode) && (a->stereoMode == b->stereoMode) && (a->redBits == b->redBits) && (a->greenBits == b->greenBits) && (a->blueBits == b->blueBits) && (a->alphaBits == b->alphaBits) &&#if 0 /* For some reason these don't get set on the client-side in libGL. */ (a->redMask == b->redMask) && (a->greenMask == b->greenMask) && (a->blueMask == b->blueMask) && (a->alphaMask == b->alphaMask) &&#endif (a->rgbBits == b->rgbBits) && (a->indexBits == b->indexBits) && (a->accumRedBits == b->accumRedBits) && (a->accumGreenBits == b->accumGreenBits) && (a->accumBlueBits == b->accumBlueBits) && (a->accumAlphaBits == b->accumAlphaBits) && (a->depthBits == b->depthBits) && (a->stencilBits == b->stencilBits) && (a->numAuxBuffers == b->numAuxBuffers) && (a->level == b->level) && (a->pixmapMode == b->pixmapMode) && (a->visualRating == b->visualRating) && (a->transparentPixel == b->transparentPixel) && ((a->transparentPixel != GLX_TRANSPARENT_RGB) || ((a->transparentRed == b->transparentRed) && (a->transparentGreen == b->transparentGreen) && (a->transparentBlue == b->transparentBlue) && (a->transparentAlpha == b->transparentAlpha))) && ((a->transparentPixel != GLX_TRANSPARENT_INDEX) || (a->transparentIndex == b->transparentIndex)) && (a->sampleBuffers == b->sampleBuffers) && (a->samples == b->samples) && ((a->drawableType & b->drawableType) != 0) && (a->renderType == b->renderType) && (a->maxPbufferWidth == b->maxPbufferWidth) && (a->maxPbufferHeight == b->maxPbufferHeight) && (a->maxPbufferPixels == b->maxPbufferPixels) && (a->optimalPbufferWidth == b->optimalPbufferWidth) && (a->optimalPbufferHeight == b->optimalPbufferHeight) && (a->swapMethod == b->swapMethod) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -