summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glx_pbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/glx_pbuffer.c')
-rw-r--r--src/glx/x11/glx_pbuffer.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c
index a602cd28817..6bcf965056a 100644
--- a/src/glx/x11/glx_pbuffer.c
+++ b/src/glx/x11/glx_pbuffer.c
@@ -189,6 +189,21 @@ determineTextureTarget(const int *attribs, int numAttribs)
return target;
}
+
+
+static GLenum
+determineTextureFormat(const int *attribs, int numAttribs)
+{
+ GLenum target = 0;
+ int i;
+
+ for (i = 0; i < numAttribs; i++) {
+ if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
+ return attribs[2 * i + 1];
+ }
+
+ return 0;
+}
#endif
/**
@@ -294,6 +309,9 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
if (pdraw != NULL && !pdraw->textureTarget)
pdraw->textureTarget =
determineTextureTarget((const int *) data, num_attributes);
+ if (pdraw != NULL && !pdraw->textureFormat)
+ pdraw->textureFormat =
+ determineTextureFormat((const int *) data, num_attributes);
}
#endif
@@ -374,6 +392,7 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig,
}
pdraw->textureTarget = determineTextureTarget(attrib_list, i);
+ pdraw->textureFormat = determineTextureFormat(attrib_list, i);
} while (0);
#endif