MxglVertex3f(GLfloat x, GLfloat y, GLfloat z) MxglColor3f(GLfloat r, GLfloat g, GLfloat b) GlBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * VERT_ELT * IMM_CHUNK, NULL, GL_DYNAMIC_DRAW) I added this code at the beginning of the listing after the includes and added a call to init_fake_immediate() in main() after the glut setup code.Ĭode: Select all #define IMM_CHUNK (1024*16) My goal is to at least not be slower than that.įirst up is the basic VBO implementation. Return 0 /* ANSI C requires main to return int. GlutAddMenuEntry("Motion off", MOTION_OFF) GlutAddMenuEntry("Remove plane", REMOVE_PLANE) GlutAddMenuEntry("Add plane", ADD_PLANE) GlutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_MULTISAMPLE) GlutChangeToMenuEntry(3, "Motion", MOTION_ON) GlutChangeToMenuEntry(3, "Motion off", MOTION_OFF) Printf("%d frames in %ld second(s)\n", g_frames, (long)t - (long)g_seconds) * paint black to blue smooth shaded polygon for background */ #define v3f glVertex3f /* v3f was the short IRIS GL name for */įloat speed /* zero speed means not flying */ This program is -not- in the public domain. * This program is freely distributable without licensing feesĪnd is provided without guarantee or warrantee expressed or Code: Select all /* Copyright (c) Mark J.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |