projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
demos: remove OSMESA stuff from Makefile
[mesa.git]
/
progs
/
demos
/
texobj.c
diff --git
a/progs/demos/texobj.c
b/progs/demos/texobj.c
index 2c0dbc18267d53c6184ce5aed484be6f6d834ec2..40bce6e56954375cc2f169e375c98f20f66db4d4 100644
(file)
--- a/
progs/demos/texobj.c
+++ b/
progs/demos/texobj.c
@@
-1,4
+1,3
@@
-/* $Id: texobj.c,v 1.5 2000/07/19 23:57:24 brianp Exp $ */
/*
* Example of using the 1.1 texture object functions.
/*
* Example of using the 1.1 texture object functions.
@@
-7,7
+6,9
@@
* Brian Paul June 1996 This file is in the public domain.
*/
* Brian Paul June 1996 This file is in the public domain.
*/
+#include <assert.h>
#include <math.h>
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glut.h"
#include <stdlib.h>
#include <string.h>
#include "GL/glut.h"
@@
-33,8
+34,6
@@
static GLboolean UseObj = GL_FALSE;
static void draw( void )
{
static void draw( void )
{
- glDepthFunc(GL_EQUAL);
- /* glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );*/
glClear( GL_COLOR_BUFFER_BIT );
glColor3f( 1.0, 1.0, 1.0 );
glClear( GL_COLOR_BUFFER_BIT );
glColor3f( 1.0, 1.0, 1.0 );
@@
-86,7
+85,13
@@
static void draw( void )
static void idle( void )
{
static void idle( void )
{
- Angle += 2.0;
+ static double t0 = -1.;
+ double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
+ if (t0 < 0.0)
+ t0 = t;
+ dt = t - t0;
+ t0 = t;
+ Angle += 120.0*dt;
glutPostRedisplay();
}
glutPostRedisplay();
}
@@
-173,6
+178,7
@@
static void init( void )
if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[0] );
if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[0] );
+ assert(glIsTexture(TexObj[0]));
#endif
}
else {
#endif
}
else {
@@
-206,7
+212,9
@@
static void init( void )
if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[1] );
if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[1] );
+ assert(glIsTexture(TexObj[1]));
#endif
#endif
+ assert(!glIsTexture(TexObj[1] + 999));
}
else {
glNewList( TexObj[1], GL_COMPILE );
}
else {
glNewList( TexObj[1], GL_COMPILE );