@@ -511,19 +511,12 @@ void Patch::Draw()
511511void Patch::DrawBorder ()
512512{
513513 glBindBuffer (GL_ARRAY_BUFFER, borderVertexBuffer);
514- #if 0
515- glEnableClientState(GL_VERTEX_ARRAY);
516- glEnableClientState(GL_COLOR_ARRAY);
517514
518- glVertexPointer(3, GL_FLOAT, sizeof(VA_TYPE_C), VA_TYPE_OFFSET(float, 0));
519- glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(VA_TYPE_C), VA_TYPE_OFFSET(float, 3));
520- #else
521515 glEnableVertexAttribArray (0 );
522516 glEnableVertexAttribArray (1 );
523517
524518 glVertexAttribPointer (0 , 3 , GL_FLOAT, false , sizeof (VA_TYPE_C), VA_TYPE_OFFSET (float , 0 ));
525519 glVertexAttribPointer (1 , 4 , GL_UNSIGNED_BYTE, false , sizeof (VA_TYPE_C), VA_TYPE_OFFSET (float , 3 ));
526- #endif
527520
528521 // only re-upload if tessellation changed for this patch
529522 if (isTesselated) {
@@ -545,37 +538,11 @@ void Patch::DrawBorder()
545538 glBufferData (GL_ARRAY_BUFFER, borderVertices.size () * sizeof (VA_TYPE_C), borderVertices.data (), GL_STATIC_DRAW);
546539 }
547540
548- if (!borderVertices.empty ())
549541 glDrawArrays (GL_TRIANGLES, 0 , borderVertices.size ());
550542 glBindBuffer (GL_ARRAY_BUFFER, 0 );
551- #if 0
552- glDisableClientState(GL_COLOR_ARRAY);
553- glDisableClientState(GL_VERTEX_ARRAY);
554- #else
543+
555544 glDisableVertexAttribArray (1 );
556545 glDisableVertexAttribArray (0 );
557- #endif
558-
559-
560-
561- #if 0
562- #define PS PATCH_SIZE
563- if (baseLeft.LeftNeighbor == nullptr) RecursGenBorderVertices(&baseLeft , { 0, PS}, {PS, 0}, { 0, 0}, {1, true}); // left border
564- if (baseLeft.RightNeighbor == nullptr) RecursGenBorderVertices(&baseLeft , { 0, PS}, {PS, 0}, { 0, 0}, {1, false}); // right border
565- if (baseRight.RightNeighbor == nullptr) RecursGenBorderVertices(&baseRight, {PS, 0}, { 0, PS}, {PS, PS}, {1, false}); // bottom border
566- if (baseRight.LeftNeighbor == nullptr) RecursGenBorderVertices(&baseRight, {PS, 0}, { 0, PS}, {PS, PS}, {1, true}); // top border
567- #undef PS
568-
569- CVertexArray* va = GetVertexArray();
570- va->Initialize();
571-
572- const VA_TYPE_C* src = borderVertices.data();
573- VA_TYPE_C* dst = va->GetTypedVertexArray<VA_TYPE_C>(borderVertices.size());
574-
575- std::memcpy(dst, src, borderVertices.size() * sizeof(VA_TYPE_C));
576-
577- va->DrawArrayC(GL_TRIANGLES);
578- #endif
579546}
580547
581548
0 commit comments