summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-18 16:17:50 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-18 16:17:50 -0600
commit54fbd8bbd4e5a484d59907bae852908e3a8b8f3c (patch)
tree2e45fac3c2505fe1131ed38e45110e1319f49806 /progs
parentb4219e35e2de783ca03e53c311a8a56f8b633aa1 (diff)
parenta0bfeb0c3ca58a1f4d978f2aaa343ed4009de079 (diff)
Merge branch 'gallium-0.1' into gallium-tex-surfaces
Diffstat (limited to 'progs')
-rw-r--r--progs/glsl/texdemo1.c4
-rw-r--r--progs/trivial/quad-tex-2d.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c
index d29ecf452b..3ceae14b96 100644
--- a/progs/glsl/texdemo1.c
+++ b/progs/glsl/texdemo1.c
@@ -48,6 +48,7 @@ static GLfloat TexXrot = 0, TexYrot = 0;
static GLfloat Xrot = 20.0, Yrot = 20.0, Zrot = 0.0;
static GLfloat EyeDist = 10;
static GLboolean Anim = GL_TRUE;
+static int win = 0;
struct uniform_info {
@@ -177,6 +178,7 @@ key(unsigned char k, int x, int y)
EyeDist = 90;
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
}
glutPostRedisplay();
@@ -554,7 +556,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
- glutCreateWindow(Demo);
+ win = glutCreateWindow(Demo);
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c
index 3a6e5237ed..97c9fc54d8 100644
--- a/progs/trivial/quad-tex-2d.c
+++ b/progs/trivial/quad-tex-2d.c
@@ -31,6 +31,7 @@ static GLenum Target = GL_TEXTURE_2D;
static GLenum Filter = GL_NEAREST;
GLenum doubleBuffer;
static float Rot = 0;
+static int win = 0;
static void Init(void)
{
@@ -88,6 +89,7 @@ static void Reshape(int width, int height)
glFrustum(-1, 1, -1, 1, 10, 20);
#endif
glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
glTranslatef(0, 0, -15);
}
@@ -101,6 +103,7 @@ static void Key(unsigned char key, int x, int y)
Rot -= 10.0;
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
default:
return;
@@ -170,7 +173,8 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ win = glutCreateWindow("First Tri");
+ if (!win) {
exit(1);
}