summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-04-09 19:20:03 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-04-09 19:20:03 +0000
commit9af443f5976ab3987e4ee9d397391e82206676b4 (patch)
tree1c39398270e7bc99b89ce09d1c9b3b4af0f07ad3
parentf02440dfa3439ab493c7918b472c23bb22e29707 (diff)
Fix passing of non-RGB visuals. The old code did not initialize theXORG-6_8_99_2
structure properly which lead to a crash in 8bpp mode
-rw-r--r--GL/windows/ChangeLog6
-rwxr-xr-xGL/windows/indirect.c26
2 files changed, 28 insertions, 4 deletions
diff --git a/GL/windows/ChangeLog b/GL/windows/ChangeLog
index e5a2e4cc7..0d58b2637 100644
--- a/GL/windows/ChangeLog
+++ b/GL/windows/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-09 Alexander Gottwald <ago at freedesktop dot org>
+
+ * indirect.c:
+ Fix passing of non-RGB visuals. The old code did not initialize the
+ structure properly which lead to a crash in 8bpp mode
+
2005-03-01 Alexander Gottwald <ago at freedesktop dot org>
* indirect.c:
diff --git a/GL/windows/indirect.c b/GL/windows/indirect.c
index df6040d9a..4c46ec960 100755
--- a/GL/windows/indirect.c
+++ b/GL/windows/indirect.c
@@ -995,6 +995,26 @@ static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
}
};
+static __GLXvisualConfig NullConfig = {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+};
+
static inline int count_bits(uint32_t x)
{
x = x - ((x >> 1) & 0x55555555);
@@ -1137,7 +1157,6 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
int is_rgb = (pVisual[i].class == TrueColor ||
pVisual[i].class == DirectColor);
-#if 0
if (!is_rgb)
{
/* We don't support non-rgb visuals for GL. But we don't
@@ -1157,14 +1176,13 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
orig_vid[j] = pVisual[i].vid;
/* Initialize the glXVisual */
- glXVisualPtr[j] = NullConfig;
- glXVisualPriv[j] = NULL;
+ _gl_copy_visual_to_context_mode( modes, & NullConfig );
+ modes->visualID = pVisualNew[j].vid;
j++;
continue;
}
-#endif
for (k = 0; k < numNewConfigs; k++) {
if (pNewVisualConfigs[k].rgba != is_rgb)