projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
799631a
)
GLX: Complain when buggy applications call GLX 1.3 functions.
author
Ian Romanick
<ian.d.romanick@intel.com>
Tue, 15 Sep 2009 20:12:22 +0000
(13:12 -0700)
committer
Ian Romanick
<ian.d.romanick@intel.com>
Tue, 15 Sep 2009 20:12:22 +0000
(13:12 -0700)
src/glx/x11/glx_pbuffer.c
patch
|
blob
|
history
diff --git
a/src/glx/x11/glx_pbuffer.c
b/src/glx/x11/glx_pbuffer.c
index a06331fd7fabf3a8ce70ec9d4a32bfa236a9a5ce..37459f846bfb8066fed25f2a38664a8a2dadfc4c 100644
(file)
--- a/
src/glx/x11/glx_pbuffer.c
+++ b/
src/glx/x11/glx_pbuffer.c
@@
-40,6
+40,23
@@
#include "glcontextmodes.h"
#include "glcontextmodes.h"
+/**
+ * Emit a warning when clients use GLX 1.3 functions on pre-1.3 systems.
+ */
+static void
+warn_GLX_1_3(Display *dpy, const char *function_name)
+{
+ __GLXdisplayPrivate *priv = __glXInitialize(dpy);
+
+ if (priv->minorVersion < 3) {
+ fprintf(stderr,
+ "WARNING: Application calling GLX 1.3 function \"%s\" "
+ "when GLX 1.3 is not supported! This is an application bug!\n",
+ function_name);
+ }
+}
+
+
/**
* Change a drawable's attribute.
*
/**
* Change a drawable's attribute.
*
@@
-559,6
+576,8
@@
glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list)
width = 0;
height = 0;
width = 0;
height = 0;
+ warn_GLX_1_3(dpy, __func__);
+
for (i = 0; attrib_list[i * 2]; i++) {
switch (attrib_list[i * 2]) {
case GLX_PBUFFER_WIDTH:
for (i = 0; attrib_list[i * 2]; i++) {
switch (attrib_list[i * 2]) {
case GLX_PBUFFER_WIDTH:
@@
-592,6
+611,7
@@
PUBLIC void
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
glXQueryDrawable(Display * dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
+ warn_GLX_1_3(dpy, __func__);
GetDrawableAttribute(dpy, drawable, attribute, value);
}
GetDrawableAttribute(dpy, drawable, attribute, value);
}
@@
-645,6
+665,8
@@
PUBLIC GLXPixmap
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list)
{
glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list)
{
+ warn_GLX_1_3(dpy, __func__);
+
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list, X_GLXCreatePixmap);
}
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list, X_GLXCreatePixmap);
}
@@
-654,6
+676,8
@@
PUBLIC GLXWindow
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
const int *attrib_list)
{
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
const int *attrib_list)
{
+ warn_GLX_1_3(dpy, __func__);
+
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list, X_GLXCreateWindow);
}
return CreateDrawable(dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list, X_GLXCreateWindow);
}
@@
-662,6
+686,8
@@
glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
PUBLIC void
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
{
PUBLIC void
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
{
+ warn_GLX_1_3(dpy, __func__);
+
DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap);
}
DestroyDrawable(dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap);
}
@@
-669,6
+695,8
@@
glXDestroyPixmap(Display * dpy, GLXPixmap pixmap)
PUBLIC void
glXDestroyWindow(Display * dpy, GLXWindow win)
{
PUBLIC void
glXDestroyWindow(Display * dpy, GLXWindow win)
{
+ warn_GLX_1_3(dpy, __func__);
+
DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow);
}
DestroyDrawable(dpy, (GLXDrawable) win, X_GLXDestroyWindow);
}