summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-07-13 20:09:18 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-07-13 20:09:18 +0000
commit601ce1d624466feed19cabbdc40484be4bc6ceec (patch)
tree532627b7d9b506eb18dc7096768fc7250f35248b
parent5b22aa1e339b77fa7e3e8ba134619c7e5ef93900 (diff)
minor tweaks
-rw-r--r--progs/demos/osdemo.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/progs/demos/osdemo.c b/progs/demos/osdemo.c
index acb9d3ab01..b43950b63d 100644
--- a/progs/demos/osdemo.c
+++ b/progs/demos/osdemo.c
@@ -1,4 +1,4 @@
-/* $Id: osdemo.c,v 1.5 2000/09/08 16:42:06 brianp Exp $ */
+/* $Id: osdemo.c,v 1.6 2001/07/13 20:09:18 brianp Exp $ */
/*
* Demo of off-screen Mesa rendering
@@ -238,14 +238,18 @@ int main( int argc, char *argv[] )
}
/* Allocate the image buffer */
- buffer = malloc( WIDTH * HEIGHT * 4 );
+ buffer = malloc( WIDTH * HEIGHT * 4 * sizeof(GLubyte) );
if (!buffer) {
printf("Alloc image buffer failed!\n");
return 0;
}
/* Bind the buffer to the context and make it current */
- OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT );
+ if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT )) {
+ printf("OSMesaMakeCurrent failed!\n");
+ return 0;
+ }
+
{
int z, s, a;