projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a2a0185
)
progs/tests: asst. changes to antialias.c
author
Brian Paul
<brianp@vmware.com>
Mon, 19 Apr 2010 19:56:21 +0000
(13:56 -0600)
committer
Brian Paul
<brianp@vmware.com>
Tue, 20 Apr 2010 16:01:52 +0000
(10:01 -0600)
progs/tests/antialias.c
patch
|
blob
|
history
diff --git
a/progs/tests/antialias.c
b/progs/tests/antialias.c
index 656bf2471fe3df76cfbd46b5a2b658968a1f7b18..a6456a52181bf2a977d24685d7af58a0dac4cd08 100644
(file)
--- a/
progs/tests/antialias.c
+++ b/
progs/tests/antialias.c
@@
-30,15
+30,17
@@
PrintString(const char *s)
static void
static void
-doPolygon( GLint verts, GLfloat radius, GLfloat z )
+doPolygon( GL
enum mode, GL
int verts, GLfloat radius, GLfloat z )
{
int i;
{
int i;
+ glBegin(mode);
for (i = 0; i < verts; i++) {
float a = (i * 2.0 * 3.14159) / verts;
float x = radius * cos(a);
float y = radius * sin(a);
glVertex3f(x, y, z);
}
for (i = 0; i < verts; i++) {
float a = (i * 2.0 * 3.14159) / verts;
float x = radius * cos(a);
float y = radius * sin(a);
glVertex3f(x, y, z);
}
+ glEnd();
}
}
@@
-47,35
+49,23
@@
DrawObject( void )
{
glLineWidth(3.0);
glColor3f(1, 1, 1);
{
glLineWidth(3.0);
glColor3f(1, 1, 1);
- glBegin(GL_LINE_LOOP);
- doPolygon(12, 1.2, 0);
- glEnd();
+ doPolygon(GL_LINE_LOOP, 12, 1.2, 0);
glLineWidth(1.0);
glColor3f(1, 1, 1);
glLineWidth(1.0);
glColor3f(1, 1, 1);
- glBegin(GL_LINE_LOOP);
- doPolygon(12, 1.1, 0);
- glEnd();
+ doPolygon(GL_LINE_LOOP, 12, 1.1, 0);
glColor3f(1, 0, 0);
glColor3f(1, 0, 0);
- glBegin(GL_POLYGON);
- doPolygon(12, 0.4, 0.3);
- glEnd();
+ doPolygon(GL_POLYGON, 12, 0.4, 0.3);
glColor3f(0, 1, 0);
glColor3f(0, 1, 0);
- glBegin(GL_POLYGON);
- doPolygon(12, 0.6, 0.2);
- glEnd();
+ doPolygon(GL_POLYGON, 12, 0.6, 0.2);
glColor3f(0, 0, 1);
glColor3f(0, 0, 1);
- glBegin(GL_POLYGON);
- doPolygon(12, 0.8, 0.1);
- glEnd();
+ doPolygon(GL_POLYGON, 12, 0.8, 0.1);
glColor3f(1, 1, 1);
glColor3f(1, 1, 1);
- glBegin(GL_POLYGON);
- doPolygon(12, 1.0, 0);
- glEnd();
+ doPolygon(GL_POLYGON, 12, 1.0, 0);
}
}
@@
-85,43
+75,46
@@
Display( void )
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glColor3f(1, 1, 1);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glColor3f(1, 1, 1);
+
+ glRasterPos2f(-3.1, -1.6);
+ PrintString("No antialiasing");
+
+ glRasterPos2f(-0.8, -1.6);
if (HaveMultisample) {
if (HaveMultisample) {
- glRasterPos2f(-3.1, -1.6);
if (DoMultisample)
if (DoMultisample)
- PrintString("MULTISAMPLE");
+ PrintString("
MULTISAMPLE");
else
PrintString("MULTISAMPLE (off)");
}
else
PrintString("MULTISAMPLE (off)");
}
- glRasterPos2f(-0.8, -1.6);
- PrintString("No antialiasing");
+ else
+ PrintString("MULTISAMPLE (N/A)");
+
glRasterPos2f(1.6, -1.6);
PrintString("GL_POLYGON_SMOOTH");
glRasterPos2f(1.6, -1.6);
PrintString("GL_POLYGON_SMOOTH");
- /* multisample */
- if (HaveMultisample) {
- glEnable(GL_DEPTH_TEST);
- if (DoMultisample)
- glEnable(GL_MULTISAMPLE_ARB);
- glPushMatrix();
- glTranslatef(-2.5, 0, 0);
- glPushMatrix();
- glRotatef(Zrot, 0, 0, 1);
- DrawObject();
- glPopMatrix();
- glPopMatrix();
- glDisable(GL_MULTISAMPLE_ARB);
- glDisable(GL_DEPTH_TEST);
- }
-
/* non-aa */
glEnable(GL_DEPTH_TEST);
glPushMatrix();
/* non-aa */
glEnable(GL_DEPTH_TEST);
glPushMatrix();
+ glTranslatef(-2.5, 0, 0);
+ glPushMatrix();
+ glRotatef(Zrot, 0, 0, 1);
+ DrawObject();
+ glPopMatrix();
+ glPopMatrix();
+ glDisable(GL_DEPTH_TEST);
+
+ /* multisample */
+ glEnable(GL_DEPTH_TEST);
+ if (HaveMultisample && DoMultisample)
+ glEnable(GL_MULTISAMPLE_ARB);
+ glPushMatrix();
glTranslatef(0, 0, 0);
glPushMatrix();
glRotatef(Zrot, 0, 0, 1);
DrawObject();
glPopMatrix();
glPopMatrix();
glTranslatef(0, 0, 0);
glPushMatrix();
glRotatef(Zrot, 0, 0, 1);
DrawObject();
glPopMatrix();
glPopMatrix();
+ glDisable(GL_MULTISAMPLE_ARB);
glDisable(GL_DEPTH_TEST);
/* polygon smooth */
glDisable(GL_DEPTH_TEST);
/* polygon smooth */