Data Setup (Transfer)
GLfloat vertices[12] = { // 12 floats
- 0.90, -0.90, 0.85, -0.90, -0.90, 0.85,
0.90, -0.85, 0.90, 0.90, -0.85, 0.90 }; // request buff ID glGenBuffers(1, &dataBuffer); // prepare to use glBindBuffer(GL_ARRAY_BUFFER, dataBuffer); // load the data in the buffer glBufferData(GL_ARRAY_BUFFER, // data is vertex attributes 12*sizeof(GLfloat), // how many bytes: 12 numbers * 4 bytes per float vertices, // where to start: in beginning of array GL_STATIC_DRAW); // data will not change
CPU GPU
f0 f1 .. f10 f11
vertices
Read mesh on CPU
f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11
Transfer data to GPU 12 numbers transferred meaning not known
- 6 2D vertices?
- 4 3D vertices?