Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 1 file). Show all
Unified · Split
| @@ -59,12 +59,6 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 58 unmodified lines | ||
| 59 | 59 | gpu::Batch batch; |
| 60 | 60 | renderSphere(batch, radius, slices, stacks, color, solid, id); |
| 61 | 61 | gpu::GLBackend::renderBatch(batch); |
| 62 | − | |
| 63 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 64 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 65 | − | |
| 66 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 67 | − glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 68 | 62 | } |
| 69 | 63 | |
| 70 | 64 | void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color, bool solid, int id) { |
| @@ -302,6 +296,12 @@ void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, in · 231 unmodified lines | ||
| 302 | 296 | } else { |
| 303 | 297 | batch.drawIndexed(gpu::LINES, indices); |
| 304 | 298 | } |
| 299 | + | |
| 300 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 301 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 302 | + | |
| 303 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 304 | + batch._glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | void GeometryCache::renderCone(float base, float height, int slices, int stacks) { |
| @@ -409,11 +409,6 @@ void GeometryCache::renderGrid(int xDivisions, int yDivisions, const glm::vec4& · 101 unmodified lines | ||
| 409 | 409 | gpu::Batch batch; |
| 410 | 410 | renderGrid(batch, xDivisions, yDivisions, color); |
| 411 | 411 | gpu::GLBackend::renderBatch(batch); |
| 412 | − | |
| 413 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 414 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 415 | − | |
| 416 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 417 | 412 | } |
| 418 | 413 | |
| 419 | 414 | void GeometryCache::renderGrid(gpu::Batch& batch, int xDivisions, int yDivisions, const glm::vec4& color) { |
| @@ -488,17 +483,17 @@ void GeometryCache::renderGrid(gpu::Batch& batch, int xDivisions, int yDivisions · 68 unmodified lines | ||
| 488 | 483 | batch.setInputBuffer(VERTICES_SLOT, verticesView); |
| 489 | 484 | batch.setInputBuffer(COLOR_SLOT, colorView); |
| 490 | 485 | batch.draw(gpu::LINES, vertices, 0); |
| 486 | + | |
| 487 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 488 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 489 | + | |
| 490 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | void GeometryCache::renderGrid(int x, int y, int width, int height, int rows, int cols, const glm::vec4& color, int id) { |
| 494 | 494 | gpu::Batch batch; |
| 495 | 495 | renderGrid(x, y, width, height, rows, cols, color, id); |
| 496 | 496 | gpu::GLBackend::renderBatch(batch); |
| 497 | − | |
| 498 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 499 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 500 | − | |
| 501 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 502 | 497 | } |
| 503 | 498 | |
| 504 | 499 | // TODO: properly handle the x,y,w,h changing for an ID |
| @@ -600,6 +595,11 @@ void GeometryCache::renderGrid(gpu::Batch& batch, int x, int y, int width, int h · 95 unmodified lines | ||
| 600 | 595 | batch.setInputBuffer(VERTICES_SLOT, verticesView); |
| 601 | 596 | batch.setInputBuffer(COLOR_SLOT, colorView); |
| 602 | 597 | batch.draw(gpu::LINES, vertices, 0); |
| 598 | + | |
| 599 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 600 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 601 | + | |
| 602 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | void GeometryCache::updateVertices(int id, const QVector<glm::vec2>& points, const glm::vec4& color) { |
| @@ -801,11 +801,6 @@ void GeometryCache::renderVertices(gpu::Primitive primitiveType, int id) { · 195 unmodified lines | ||
| 801 | 801 | gpu::Batch batch; |
| 802 | 802 | renderVertices(batch, primitiveType, id); |
| 803 | 803 | gpu::GLBackend::renderBatch(batch); |
| 804 | − | |
| 805 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 806 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 807 | − | |
| 808 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 809 | 804 | } |
| 810 | 805 | |
| 811 | 806 | void GeometryCache::renderVertices(gpu::Batch& batch, gpu::Primitive primitiveType, int id) { |
| @@ -814,6 +809,11 @@ void GeometryCache::renderVertices(gpu::Batch& batch, gpu::Primitive primitiveTy · 2 unmodified lines | ||
| 814 | 809 | batch.setInputFormat(details.streamFormat); |
| 815 | 810 | batch.setInputStream(0, *details.stream); |
| 816 | 811 | batch.draw(primitiveType, details.vertices, 0); |
| 812 | + | |
| 813 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 814 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 815 | + | |
| 816 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 817 | 817 | } |
| 818 | 818 | } |
| 819 | 819 | |
| @@ -821,12 +821,6 @@ void GeometryCache::renderSolidCube(float size, const glm::vec4& color) { · 1 unmodified line | ||
| 821 | 821 | gpu::Batch batch; |
| 822 | 822 | renderSolidCube(batch, size, color); |
| 823 | 823 | gpu::GLBackend::renderBatch(batch); |
| 824 | − | |
| 825 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 826 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 827 | − | |
| 828 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 829 | − glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 830 | 824 | } |
| 831 | 825 | |
| 832 | 826 | void GeometryCache::renderSolidCube(gpu::Batch& batch, float size, const glm::vec4& color) { |
| @@ -941,18 +935,18 @@ void GeometryCache::renderSolidCube(gpu::Batch& batch, float size, const glm::ve · 108 unmodified lines | ||
| 941 | 935 | batch.setInputBuffer(COLOR_SLOT, colorView); |
| 942 | 936 | batch.setIndexBuffer(gpu::UINT8, _solidCubeIndexBuffer, 0); |
| 943 | 937 | batch.drawIndexed(gpu::TRIANGLES, indices); |
| 938 | + | |
| 939 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 940 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 941 | + | |
| 942 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 943 | + batch._glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | void GeometryCache::renderWireCube(float size, const glm::vec4& color) { |
| 947 | 947 | gpu::Batch batch; |
| 948 | 948 | renderWireCube(batch, size, color); |
| 949 | 949 | gpu::GLBackend::renderBatch(batch); |
| 950 | − | |
| 951 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 952 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 953 | − | |
| 954 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 955 | − glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 956 | 950 | } |
| 957 | 951 | |
| 958 | 952 | void GeometryCache::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) { |
| @@ -1030,17 +1024,18 @@ void GeometryCache::renderWireCube(gpu::Batch& batch, float size, const glm::vec · 71 unmodified lines | ||
| 1030 | 1024 | batch.setInputBuffer(COLOR_SLOT, colorView); |
| 1031 | 1025 | batch.setIndexBuffer(gpu::UINT8, _wireCubeIndexBuffer, 0); |
| 1032 | 1026 | batch.drawIndexed(gpu::LINES, indices); |
| 1027 | + | |
| 1028 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1029 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1030 | + | |
| 1031 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1032 | + batch._glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | void GeometryCache::renderBevelCornersRect(int x, int y, int width, int height, int bevelDistance, const glm::vec4& color, int id) { |
| 1036 | 1036 | gpu::Batch batch; |
| 1037 | 1037 | renderBevelCornersRect(batch, x, y, width, height, bevelDistance, color, id); |
| 1038 | 1038 | gpu::GLBackend::renderBatch(batch); |
| 1039 | − | |
| 1040 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1041 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1042 | − | |
| 1043 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1044 | 1039 | } |
| 1045 | 1040 | |
| 1046 | 1041 | void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int width, int height, int bevelDistance, const glm::vec4& color, int id) { |
| @@ -1139,17 +1134,17 @@ void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int · 92 unmodified lines | ||
| 1139 | 1134 | batch.setInputFormat(details.streamFormat); |
| 1140 | 1135 | batch.setInputStream(0, *details.stream); |
| 1141 | 1136 | batch.draw(gpu::QUADS, 4, 0); |
| 1137 | + | |
| 1138 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1139 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1140 | + | |
| 1141 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxCorner, const glm::vec4& color, int id) { |
| 1145 | 1145 | gpu::Batch batch; |
| 1146 | 1146 | renderQuad(batch, minCorner, maxCorner, color, id); |
| 1147 | 1147 | gpu::GLBackend::renderBatch(batch); |
| 1148 | − | |
| 1149 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1150 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1151 | − | |
| 1152 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1153 | 1148 | } |
| 1154 | 1149 | |
| 1155 | 1150 | void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner, const glm::vec4& color, int id) { |
| @@ -1221,6 +1216,11 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, co · 65 unmodified lines | ||
| 1221 | 1216 | batch.setInputFormat(details.streamFormat); |
| 1222 | 1217 | batch.setInputStream(0, *details.stream); |
| 1223 | 1218 | batch.draw(gpu::QUADS, 4, 0); |
| 1219 | + | |
| 1220 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1221 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1222 | + | |
| 1223 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxCorner, |
| @@ -1229,12 +1229,6 @@ void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxC · 2 unmodified lines | ||
| 1229 | 1229 | gpu::Batch batch; |
| 1230 | 1230 | renderQuad(batch, minCorner, maxCorner, texCoordMinCorner, texCoordMaxCorner, color, id); |
| 1231 | 1231 | gpu::GLBackend::renderBatch(batch); |
| 1232 | − | |
| 1233 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1234 | − glDisableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 1235 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1236 | − | |
| 1237 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1238 | 1232 | } |
| 1239 | 1233 | |
| 1240 | 1234 | void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner, |
| @@ -1315,17 +1309,18 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, co · 74 unmodified lines | ||
| 1315 | 1309 | batch.setInputFormat(details.streamFormat); |
| 1316 | 1310 | batch.setInputStream(0, *details.stream); |
| 1317 | 1311 | batch.draw(gpu::QUADS, 4, 0); |
| 1312 | + | |
| 1313 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1314 | + batch._glDisableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 1315 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1316 | + | |
| 1317 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | 1320 | void GeometryCache::renderQuad(const glm::vec3& minCorner, const glm::vec3& maxCorner, const glm::vec4& color, int id) { |
| 1321 | 1321 | gpu::Batch batch; |
| 1322 | 1322 | renderQuad(batch, minCorner, maxCorner, color, id); |
| 1323 | 1323 | gpu::GLBackend::renderBatch(batch); |
| 1324 | − | |
| 1325 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1326 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1327 | − | |
| 1328 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1329 | 1324 | } |
| 1330 | 1325 | |
| 1331 | 1326 | void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& minCorner, const glm::vec3& maxCorner, const glm::vec4& color, int id) { |
| @@ -1397,6 +1392,11 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& minCorner, co · 65 unmodified lines | ||
| 1397 | 1392 | batch.setInputFormat(details.streamFormat); |
| 1398 | 1393 | batch.setInputStream(0, *details.stream); |
| 1399 | 1394 | batch.draw(gpu::QUADS, 4, 0); |
| 1395 | + | |
| 1396 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1397 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1398 | + | |
| 1399 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | 1402 | void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottomLeft, |
| @@ -1407,16 +1407,7 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 4 unmodified lines | ||
| 1407 | 1407 | gpu::Batch batch; |
| 1408 | 1408 | renderQuad(batch, topLeft, bottomLeft, bottomRight, topRight, texCoordTopLeft, texCoordBottomLeft, |
| 1409 | 1409 | texCoordBottomRight, texCoordTopRight, color, id); |
| 1410 | − | |
| 1411 | − glEnable(GL_TEXTURE_2D); | |
| 1412 | − | |
| 1413 | 1410 | gpu::GLBackend::renderBatch(batch); |
| 1414 | − | |
| 1415 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1416 | − glDisableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 1417 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1418 | − | |
| 1419 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1420 | 1411 | } |
| 1421 | 1412 | |
| 1422 | 1413 | void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& topLeft, const glm::vec3& bottomLeft, |
| @@ -1506,29 +1497,24 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& topLeft, cons · 83 unmodified lines | ||
| 1506 | 1497 | details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer); |
| 1507 | 1498 | details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors); |
| 1508 | 1499 | } |
| 1509 | − | |
| 1510 | − //glBindTexture(GL_TEXTURE_2D, _currentTextureID); // this is quad specific... | |
| 1500 | + | |
| 1501 | + batch._glEnable(GL_TEXTURE_2D); | |
| 1511 | 1502 | |
| 1512 | 1503 | batch.setInputFormat(details.streamFormat); |
| 1513 | 1504 | batch.setInputStream(0, *details.stream); |
| 1514 | 1505 | batch.draw(gpu::QUADS, 4, 0); |
| 1515 | 1506 | |
| 1516 | − // TODO: The callers of this method (renderMagnifier and renderReticle) assume that we won't disable an unbind | |
| 1517 | − // the texture after rendering. I'm not sure if this is correct in general but it's currently required for the | |
| 1518 | − // oculus overlay to work. | |
| 1519 | − //glBindTexture(GL_TEXTURE_2D, 0); | |
| 1520 | − //glDisable(GL_TEXTURE_2D); | |
| 1507 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1508 | + batch._glDisableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 1509 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1510 | + | |
| 1511 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1521 | 1512 | } |
| 1522 | 1513 | |
| 1523 | 1514 | void GeometryCache::renderDashedLine(const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id) { |
| 1524 | 1515 | gpu::Batch batch; |
| 1525 | 1516 | renderDashedLine(batch, start, end, color, id); |
| 1526 | 1517 | gpu::GLBackend::renderBatch(batch); |
| 1527 | − | |
| 1528 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1529 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1530 | − | |
| 1531 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1532 | 1518 | } |
| 1533 | 1519 | |
| 1534 | 1520 | void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id) { |
| @@ -1634,6 +1620,11 @@ void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start, · 99 unmodified lines | ||
| 1634 | 1620 | batch.setInputFormat(details.streamFormat); |
| 1635 | 1621 | batch.setInputStream(0, *details.stream); |
| 1636 | 1622 | batch.draw(gpu::LINES, details.vertices, 0); |
| 1623 | + | |
| 1624 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1625 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1626 | + | |
| 1627 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1637 | 1628 | } |
| 1638 | 1629 | |
| 1639 | 1630 | |
| @@ -1690,10 +1681,6 @@ void GeometryCache::renderLine(const glm::vec3& p1, const glm::vec3& p2, · 50 unmodified lines | ||
| 1690 | 1681 | gpu::Batch batch; |
| 1691 | 1682 | renderLine(batch, p1, p2, color1, color2, id); |
| 1692 | 1683 | gpu::GLBackend::renderBatch(batch); |
| 1693 | − | |
| 1694 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1695 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1696 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1697 | 1684 | } |
| 1698 | 1685 | |
| 1699 | 1686 | void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm::vec3& p2, |
| @@ -1778,16 +1765,17 @@ void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm · 78 unmodified lines | ||
| 1778 | 1765 | batch.setInputFormat(details.streamFormat); |
| 1779 | 1766 | batch.setInputStream(0, *details.stream); |
| 1780 | 1767 | batch.draw(gpu::LINES, 2, 0); |
| 1768 | + | |
| 1769 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1770 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1771 | + | |
| 1772 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1781 | 1773 | } |
| 1782 | 1774 | |
| 1783 | 1775 | void GeometryCache::renderLine(const glm::vec2& p1, const glm::vec2& p2, const glm::vec4& color1, const glm::vec4& color2, int id) { |
| 1784 | 1776 | gpu::Batch batch; |
| 1785 | 1777 | renderLine(batch, p1, p2, color1, color2, id); |
| 1786 | 1778 | gpu::GLBackend::renderBatch(batch); |
| 1787 | − | |
| 1788 | − glDisableClientState(GL_VERTEX_ARRAY); | |
| 1789 | − glDisableClientState(GL_COLOR_ARRAY); | |
| 1790 | − glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1791 | 1779 | } |
| 1792 | 1780 | |
| 1793 | 1781 | void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2, |
| @@ -1872,6 +1860,11 @@ void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm · 78 unmodified lines | ||
| 1872 | 1860 | batch.setInputFormat(details.streamFormat); |
| 1873 | 1861 | batch.setInputStream(0, *details.stream); |
| 1874 | 1862 | batch.draw(gpu::LINES, 2, 0); |
| 1863 | + | |
| 1864 | + batch._glDisableClientState(GL_VERTEX_ARRAY); | |
| 1865 | + batch._glDisableClientState(GL_COLOR_ARRAY); | |
| 1866 | + | |
| 1867 | + batch._glBindBuffer(GL_ARRAY_BUFFER, 0); | |
| 1875 | 1868 | } |
| 1876 | 1869 | |
| 1877 | 1870 | |