glLoadMatrixf(0x1b33fb0 -> { { 0.68588, -0.31737, 0.654862, 0 }, { 0.727634, 0.312469, -0.610666, 0 }, { -0.0108168, 0.895343, 0.445245, 0 }, { -0.338183, -0.376694, -11.2523, 1 } }) glColor3ubv(0x7fff66e3a650 -> { 38, 38, 110 }) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glMultMatrixf(0x1b6086c -> { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } }) glColor3ub(0, 0, 0) glColor3ub(255, 140, 25) glFrontFace(GL_CCW) glLineWidth(2) glDepthMask(GL_FALSE) // buffer 2 holds indices for outline drawing. cube has 12 edges. each edge is // given as two indices, each index as unsigned int. that gives 96 bytes. glGenBuffersARB(1, 0x364c010 -> { 2 }) glBindBufferARB(GL_ARRAY_BUFFER, 2) glBufferDataARB(GL_ARRAY_BUFFER, 96, NULL, GL_STATIC_DRAW) glBindBufferARB(GL_ARRAY_BUFFER, 0) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 2) glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER, 96, NULL, GL_STATIC_DRAW) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY) = 0x7ff90d41a000 glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER) = GL_TRUE glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0) // buffer 3 holds cube's vertices. cube has 6 faces, which are rendered as 12 // triangles. each triangle has 3 vertices, each vertex 3 coordinates and // each coordinate is 4-byte float. that gives 432 bytes. glGenBuffersARB(1, 0x3644590 -> { 3 }) glBindBufferARB(GL_ARRAY_BUFFER, 3) glBufferDataARB(GL_ARRAY_BUFFER, 432, NULL, GL_STATIC_DRAW) glBindBufferARB(GL_ARRAY_BUFFER, 0) glBindBufferARB(GL_ARRAY_BUFFER, 3) glBufferDataARB(GL_ARRAY_BUFFER, 432, NULL, GL_STATIC_DRAW) glMapBufferARB(GL_ARRAY_BUFFER, GL_WRITE_ONLY) = 0x7ff90d407000 glUnmapBufferARB(GL_ARRAY_BUFFER) = GL_TRUE glBindBufferARB(GL_ARRAY_BUFFER, 0) glEnableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER, 3) glVertexPointer(3, GL_FLOAT, 0, NULL) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 2) ----> glDrawElements(GL_LINES, 24, GL_UNSIGNED_INT, NULL) glDisableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0) glBindBufferARB(GL_ARRAY_BUFFER, 0) ------------------------------------------------------------------------------- glLineWidth(1) glDepthMask(GL_TRUE) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (GLboolean) 4) glEnable(GL_LIGHTING) glFrontFace(GL_CCW) // buffer 3 is rebound as vertex coordinates glEnableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER, 3) glVertexPointer(3, GL_FLOAT, 0, NULL) // buffer 4 holds face normals. normal is given for each triangle's vertex, // so size is the same as vertes buffer's glGenBuffersARB(1, 0x3649370 -> { 4 }) glBindBufferARB(GL_ARRAY_BUFFER, 4) glBufferDataARB(GL_ARRAY_BUFFER, 432, NULL, GL_STATIC_DRAW) glBindBufferARB(GL_ARRAY_BUFFER, 0) glBindBufferARB(GL_ARRAY_BUFFER, 4) glBufferDataARB(GL_ARRAY_BUFFER, 432, NULL, GL_STATIC_DRAW) glMapBufferARB(GL_ARRAY_BUFFER, GL_WRITE_ONLY) = 0x7ff90d406000 glUnmapBufferARB(GL_ARRAY_BUFFER) = GL_TRUE glBindBufferARB(GL_ARRAY_BUFFER, 0) glEnableClientState(GL_NORMAL_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER, 4) glNormalPointer(GL_FLOAT, 0, NULL) glShadeModel(GL_SMOOTH) glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, 0x154bae8 -> { 0.724089, 0.724089, 0.724089, 1 }) glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, 0x154baf8 -> { 0.735357, 0.735357, 0.735357, 1 }) ----> glDrawArrays(GL_TRIANGLES, 0, 36) glDisableClientState(GL_VERTEX_ARRAY) glDisableClientState(GL_NORMAL_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER, 0) glShadeModel(GL_FLAT) glFrontFace(GL_CCW) glDisable(GL_LIGHTING) glColor3ub(255, 140, 25) glEnableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER, 3) glVertexPointer(3, GL_FLOAT, 0, NULL) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 2) glDisableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0) glBindBufferARB(GL_ARRAY_BUFFER, 0)