/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
+#define GL_GLEXT_PROTOTYPES
#define GLX_GLXEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glx.h>
static GLXContext Context;
static Window Win[2]; /* Win[0] = source, Win[1] = dest */
static GLint Width[2], Height[2];
-
+static GLboolean TestClipping = GL_FALSE;
static GLfloat Angle = 0.0;
static GLboolean DrawFront = GL_FALSE;
glMatrixMode(GL_MODELVIEW);
glShadeModel(GL_FLAT);
- glClearColor(0.5, 0.5, 0.5, 1.0);
+ glClearColor(0.5, 0.5, 0.5, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
/* draw blue quad */
return;
}
- /* raster pos setup */
- glViewport(0, 0, Width[1], Height[1]);
- glPushMatrix();
- glLoadIdentity();
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(-1, 1, -1, 1, -1, 1);
- glRasterPos2f(-1, -1);
-
/* copy the image between windows */
- glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
+ if (TestClipping) {
+ glWindowPos2iARB(-2, -2);
+ glCopyPixels(-2, -2, Width[0] + 4, Height[0] + 4, GL_COLOR);
+ }
+ else {
+ glWindowPos2iARB(0, 0);
+ glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
+ }
if (DrawFront)
glFinish();
int
main(int argc, char *argv[])
{
+ if (argc > 1 && strcmp(argv[1], "-clip") == 0)
+ TestClipping = GL_TRUE;
Init();
EventLoop();
return 0;