summaryrefslogtreecommitdiff
path: root/progs/trivial/vp-tri.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-02-10 16:44:02 -0700
committerBrian Paul <brianp@vmware.com>2009-02-10 16:44:02 -0700
commit5340b6dff73a0a23531ce2a5f28fba8303adab6e (patch)
treeb141fc3648568dd8b941c966059e6ed32a8bd0ad /progs/trivial/vp-tri.c
parent9fd26daec24f21dbe17afcb2e2ab272667ee9a69 (diff)
parentee4c921b65fb76998711f3c40330505cbc49a0e0 (diff)
Merge commit 'origin/gallium-master-merge'
This is the big merge of the gallium-0.2 branch into master. gallium-master-merge was just the staging area for it. Both gallium-0.2 and gallium-master-merge are considered closed now. Conflicts: progs/demos/Makefile src/mesa/main/state.c src/mesa/main/texenvprogram.c
Diffstat (limited to 'progs/trivial/vp-tri.c')
-rw-r--r--progs/trivial/vp-tri.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/progs/trivial/vp-tri.c b/progs/trivial/vp-tri.c
index f8e18654c6..2932977314 100644
--- a/progs/trivial/vp-tri.c
+++ b/progs/trivial/vp-tri.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -43,17 +43,17 @@ static void Init( void )
static void Display( void )
{
glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT );
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable(GL_VERTEX_PROGRAM_NV);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-0.9, 0.0, 0.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
glEnd();
@@ -93,8 +93,9 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );