-
/*
- * GL_ARB_multitexture demo
+ * GL_ARB_pixel_buffer_object test
*
* Command line options:
- * -info print GL implementation information
- *
+ * -w WIDTH -h HEIGHT sets window size
*
- * Brian Paul November 1998 This program is in the public domain.
- * Modified on 12 Feb 2002 for > 2 texture units.
*/
#define GL_GLEXT_PROTOTYPES
#define PBO 11
#define QUIT 100
+static GLuint DrawPBO;
+
static GLboolean Animate = GL_TRUE;
static GLboolean use_pbo = 1;
static GLboolean whole_rect = 1;
}
}
-static int max( int a, int b ) { return a > b ? a : b; }
+/*static int max( int a, int b ) { return a > b ? a : b; }*/
static int min( int a, int b ) { return a < b ? a : b; }
static void DrawObject()
* release the old copy of the texture and allocate a new one
* without waiting for outstanding rendering to complete.
*/
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, size, NULL, GL_STREAM_DRAW_ARB);
{
printf("char %d\n", (unsigned char)(Drift * 255));
- memset(image, size, (unsigned char)(Drift * 255));
+ memset(image, (unsigned char)(Drift * 255), size);
glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT);
}
if (image == NULL)
image = malloc(size);
- memset(image, size, (unsigned char)(Drift * 255));
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
+
+ memset(image, (unsigned char)(Drift * 255), size);
/* BGRA should be the fast path for regular uploads as well.
*/
static void Init( int argc, char *argv[] )
{
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
- GLuint texObj, DrawPBO;
+ GLuint texObj;
GLint size;
- if (!strstr(exten, "GL_ARB_multitexture")) {
- printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
+ if (!strstr(exten, "GL_ARB_pixel_buffer_object")) {
+ printf("Sorry, GL_ARB_pixel_buffer_object not supported by this renderer.\n");
exit(1);
}