summaryrefslogtreecommitdiffstats
path: root/progs/xdemos
diff options
context:
space:
mode:
Diffstat (limited to 'progs/xdemos')
-rw-r--r--progs/xdemos/texture_from_pixmap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/progs/xdemos/texture_from_pixmap.c b/progs/xdemos/texture_from_pixmap.c
index 22229567036..50870c4df4a 100644
--- a/progs/xdemos/texture_from_pixmap.c
+++ b/progs/xdemos/texture_from_pixmap.c
@@ -41,6 +41,9 @@
#include <unistd.h>
+static float top, bottom;
+
+
static Display *
OpenDisplay(void)
{
@@ -71,7 +74,6 @@ ChoosePixmapFBConfig(Display *display)
int screen = DefaultScreen(display);
GLXFBConfig *fbconfigs;
int i, nfbconfigs, value;
- float top, bottom;
fbconfigs = glXGetFBConfigs(display, screen, &nfbconfigs);
for (i = 0; i < nfbconfigs; i++) {
@@ -273,13 +275,13 @@ Redraw(Display *dpy, Window win, float rot)
glRotatef(2.0 * rot, 1, 0, 0);
glBegin(GL_QUADS);
- glTexCoord2d(0.0, 0.0);
+ glTexCoord2d(0.0, bottom);
glVertex2f(-1, -1);
- glTexCoord2d(1.0, 0.0);
+ glTexCoord2d(1.0, bottom);
glVertex2f( 1, -1);
- glTexCoord2d(1.0, 1.0);
+ glTexCoord2d(1.0, top);
glVertex2d(1.0, 1.0);
- glTexCoord2d(0.0, 1.0);
+ glTexCoord2d(0.0, top);
glVertex2f(-1.0, 1.0);
glEnd();