Changeset 1077
- Timestamp:
- Nov 19, 2011, 2:00:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/tutorial/tut03.cpp
r1076 r1077 406 406 m_ready = true; 407 407 408 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__408 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 409 409 /* Method 1: store vertex buffer on the GPU memory */ 410 410 glGenBuffers(1, &m_vbo); … … 416 416 glBufferData(GL_ARRAY_BUFFER, sizeof(texcoords), texcoords, 417 417 GL_STATIC_DRAW); 418 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__418 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ 419 419 /* Method 2: upload vertex information at each frame */ 420 420 #else … … 445 445 } 446 446 447 /* If other frames are dirty, upload fake data for now */448 if (0) for (int i = 0; i < 4; i++)449 {450 if (m_dirty[i])451 {452 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i * m_size.y / 2,453 m_size.x / 2, m_size.y / 2,454 TEXTURE_FORMAT, TEXTURE_TYPE,455 m_pixels + m_size.x * m_size.y / 4 * m_frame);456 }457 }458 459 447 m_shader->Bind(); 460 448 m_shader->SetUniform(m_pixeluni, m_pixel_delta); 461 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__449 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 462 450 glBindBuffer(GL_ARRAY_BUFFER, m_vbo); 463 451 glEnableVertexAttribArray(m_vertexattrib); … … 467 455 glEnableVertexAttribArray(m_texattrib); 468 456 glVertexAttribPointer(m_texattrib, 2, GL_FLOAT, GL_FALSE, 0, 0); 469 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__457 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ 470 458 /* Never used for now */ 471 459 //glEnableVertexAttribArray(m_vertexattrib); … … 480 468 glDrawArrays(GL_TRIANGLES, 0, 6); 481 469 482 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__470 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 483 471 glDisableVertexAttribArray(m_vertexattrib); 484 472 glDisableVertexAttribArray(m_texattrib); 485 473 glBindBuffer(GL_ARRAY_BUFFER, 0); 486 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__474 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ 487 475 /* Never used for now */ 488 476 //glDisableVertexAttribArray(m_vertexattrib); … … 502 490 Shader *m_shader; 503 491 GLuint m_texid; 504 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__492 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 505 493 GLuint m_vbo, m_tbo; 506 494 GLuint m_tco; … … 520 508 }; 521 509 522 int main( )510 int main(int argc, char **argv) 523 511 { 524 512 #if defined _WIN32
Note: See TracChangeset
for help on using the changeset viewer.