Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 268 vs 272 for /trunk/Source Code/Libs/src/GLIM/glimBatchData.cpp

Diff revisions: vs.
  @@ -123,7 +123,7 @@
123 123 if (m_bCreatedVBOs)
124 124 {
125 125 m_bCreatedVBOs = false;
126 -
126 + glDeleteVertexArrays(1, &m_VertexArrayObjectID);
127 127 glDeleteBuffers (1, &m_uiVertexBufferID);
128 128 glDeleteBuffers (1, &m_uiElementBufferID_Points);
129 129 glDeleteBuffers (1, &m_uiElementBufferID_Lines);
  @@ -373,11 +373,12 @@
373 373
374 374 void glimBatchData::UnbindOGL (void)
375 375 {
376 - GL_API::setActiveBuffer(GL_ARRAY_BUFFER, 0);
376 + GL_API::setActiveVAO(0);
377 + /*GL_API::setActiveBuffer(GL_ARRAY_BUFFER, 0);
377 378 GL_API::setActiveBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
378 379
379 380 for (int i = 0; i < 16; ++i)
380 - glDisableVertexAttribArray (i);
381 + glDisableVertexAttribArray (i);*/
381 382 }
382 383
383 384 void glimBatchData::BindOGL (unsigned int uiCurrentProgram)
  @@ -385,12 +386,7 @@
385 386 if (!m_bUploadedToGPU)
386 387 return;
387 388
388 - if (GLEW_NV_vertex_buffer_unified_memory)
389 - {
390 - //glDisableClientState (GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV);
391 - //glDisableClientState (GL_ELEMENT_ARRAY_UNIFIED_NV);
392 - }
393 -
389 + GL_API::setActiveVAO(m_VertexArrayObjectID);
394 390 GL_API::setActiveBuffer(GL_ARRAY_BUFFER, m_uiVertexBufferID);
395 391 std::map<std::string, GlimArrayData>::iterator it, itend;
396 392 itend = m_Attributes.end ();
  @@ -452,19 +448,13 @@
452 448
453 449 m_bUploadedToGPU = true;
454 450
455 -
456 - if (GLEW_NV_vertex_buffer_unified_memory)
457 - {
458 - //glDisableClientState (GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV);
459 - //glDisableClientState (GL_ELEMENT_ARRAY_UNIFIED_NV);
460 - }
461 -
462 451 const unsigned int uiVertexDataSize = (unsigned int) getVertexDataSize ();
463 452 const unsigned int uiVertices = (unsigned int) (m_PositionData.size ()) / 3;
464 453
465 454 if (!m_bCreatedVBOs)
466 455 {
467 456 m_bCreatedVBOs = true;
457 + glGenVertexArrays(1, &m_VertexArrayObjectID);
468 458 glGenBuffers (1, &m_uiVertexBufferID);
469 459 glGenBuffers (1, &m_uiElementBufferID_Points);
470 460 glGenBuffers (1, &m_uiElementBufferID_Lines);