Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / glx / glxconfig.c
index 1d9678f48cdac125a6845e32a13c1593673201ad..6c4267c8f3952cdf454223b36b141635ca2f889b 100644 (file)
@@ -32,7 +32,6 @@
  */
 
 #include <GL/glx.h>
-#include "GL/glxint.h"
 #include <stdlib.h>
 #include <string.h>
 
@@ -60,7 +59,7 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
       *value_return = mode->rgbBits;
       return 0;
    case GLX_RGBA:
-      *value_return = mode->rgbMode;
+      *value_return = !(mode->renderType & GLX_COLOR_INDEX_BIT);
       return 0;
    case GLX_RED_SIZE:
       *value_return = mode->redBits;
@@ -188,6 +187,10 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
       *value_return = mode->yInverted;
       return 0;
 
+   case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
+      *value_return = mode->sRGBCapable;
+      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.
@@ -209,10 +212,6 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
  * 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 struct glx_config 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.
  */
@@ -226,14 +225,13 @@ glx_config_create_list(unsigned count)
 
    next = &base;
    for (i = 0; i < count; i++) {
-      *next = (struct glx_config *) malloc(size);
+      *next = calloc(1, size);
       if (*next == NULL) {
         glx_config_destroy_list(base);
         base = NULL;
         break;
       }
 
-      (void) memset(*next, 0, size);
       (*next)->visualID = GLX_DONT_CARE;
       (*next)->visualType = GLX_DONT_CARE;
       (*next)->visualRating = GLX_NONE;
@@ -251,6 +249,7 @@ glx_config_create_list(unsigned count)
       (*next)->bindToMipmapTexture = GLX_DONT_CARE;
       (*next)->bindToTextureTargets = GLX_DONT_CARE;
       (*next)->yInverted = GLX_DONT_CARE;
+      (*next)->sRGBCapable = GLX_DONT_CARE;
 
       next = &((*next)->next);
    }