summaryrefslogtreecommitdiff
path: root/progs/trivial/tri.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-02-09 09:22:22 -0700
committerBrian Paul <brianp@vmware.com>2009-02-09 09:22:22 -0700
commite97681c7f551a2a2a6bd5eff0f4192a870c816c0 (patch)
treedff2bf0e6d22efb92af131f64be0621ed316977c /progs/trivial/tri.c
parent1a46c8a062aea59de5cf55881104489db5d609e5 (diff)
parentb907d4cd8fafe719b4f87d877562829548937485 (diff)
mesa: merge gallium-0.2 into gallium-master-merge
Merge commit 'origin/gallium-0.2' into gallium-master-merge Conflicts: Makefile docs/relnotes-7.4.html docs/relnotes.html src/mesa/drivers/dri/i965/brw_wm.h src/mesa/main/imports.c src/mesa/main/mtypes.h src/mesa/main/texcompress.c src/mesa/main/texenvprogram.c src/mesa/main/version.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_draw.c
Diffstat (limited to 'progs/trivial/tri.c')
-rw-r--r--progs/trivial/tri.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c
index d4a7f08ae3..d3c6b59ea5 100644
--- a/progs/trivial/tri.c
+++ b/progs/trivial/tri.c
@@ -32,7 +32,7 @@
#define CI_OFFSET_2 32
-GLenum doubleBuffer;
+GLenum doubleBuffer = 1;
int win;
static void Init(void)
@@ -41,7 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearColor(0.3, 0.1, 0.3, 0.0);
}
static void Reshape(int width, int height)
@@ -57,16 +57,13 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
- switch (key) {
- case 27:
- glutDestroyWindow(win);
- exit(0);
- default:
- return;
- }
-
- glutPostRedisplay();
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
}
static void Draw(void)
@@ -74,12 +71,12 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
+ glVertex3f(-0.9, -0.9, -30.0);
glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
glEnd();
glFlush();
@@ -93,8 +90,6 @@ static GLenum Args(int argc, char **argv)
{
GLint i;
- doubleBuffer = GL_FALSE;
-
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
doubleBuffer = GL_FALSE;
@@ -120,7 +115,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -135,5 +130,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}