History

remove non-batch versions of GeometryCache renderXYZ() methods

ZappoMan committed 11 years ago

Commit c2113ea1 parent 36f63e412 files · +13 −203Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 12 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+0−98
@@ -54,12 +54,6 @@ const int NUM_TRIANGLES_PER_QUAD = 2; · 53 unmodified lines
5454 const int NUM_VERTICES_PER_TRIANGULATED_QUAD = NUM_VERTICES_PER_TRIANGLE * NUM_TRIANGLES_PER_QUAD;
5555 const int NUM_COORDS_PER_VERTEX = 3;
5656
57−void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm::vec4& color, bool solid, int id) {
58− gpu::Batch batch;
59− renderSphere(batch, radius, slices, stacks, color, solid, id);
60− gpu::GLBackend::renderBatch(batch);
61−}
62−
6357 void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color, bool solid, int id) {
6458 bool registered = (id != UNKNOWN_ID);
6559
@@ -304,12 +298,6 @@ void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, in · 238 unmodified lines
304298 }
305299 }
306300
307−void GeometryCache::renderGrid(int xDivisions, int yDivisions, const glm::vec4& color) {
308− gpu::Batch batch;
309− renderGrid(batch, xDivisions, yDivisions, color);
310− gpu::GLBackend::renderBatch(batch);
311−}
312−
313301 void GeometryCache::renderGrid(gpu::Batch& batch, int xDivisions, int yDivisions, const glm::vec4& color) {
314302 IntPair key(xDivisions, yDivisions);
315303 Vec3Pair colorKey(glm::vec3(color.x, color.y, yDivisions), glm::vec3(color.z, color.y, xDivisions));
@@ -384,12 +372,6 @@ void GeometryCache::renderGrid(gpu::Batch& batch, int xDivisions, int yDivisions · 68 unmodified lines
384372 batch.draw(gpu::LINES, vertices, 0);
385373 }
386374
387−void GeometryCache::renderGrid(int x, int y, int width, int height, int rows, int cols, const glm::vec4& color, int id) {
388− gpu::Batch batch;
389− renderGrid(batch, x, y, width, height, rows, cols, color, id);
390− gpu::GLBackend::renderBatch(batch);
391−}
392−
393375 // TODO: why do we seem to create extra BatchItemDetails when we resize the window?? what's that??
394376 void GeometryCache::renderGrid(gpu::Batch& batch, int x, int y, int width, int height, int rows, int cols, const glm::vec4& color, int id) {
395377 #ifdef WANT_DEBUG
@@ -691,12 +673,6 @@ void GeometryCache::updateVertices(int id, const QVector<glm::vec3>& points, con · 295 unmodified lines
691673 #endif
692674 }
693675
694−void GeometryCache::renderVertices(gpu::Primitive primitiveType, int id) {
695− gpu::Batch batch;
696− renderVertices(batch, primitiveType, id);
697− gpu::GLBackend::renderBatch(batch);
698−}
699−
700676 void GeometryCache::renderVertices(gpu::Batch& batch, gpu::Primitive primitiveType, int id) {
701677 BatchItemDetails& details = _registeredVertices[id];
702678 if (details.isCreated) {
@@ -706,12 +682,6 @@ void GeometryCache::renderVertices(gpu::Batch& batch, gpu::Primitive primitiveTy · 3 unmodified lines
706682 }
707683 }
708684
709−void GeometryCache::renderSolidCube(float size, const glm::vec4& color) {
710− gpu::Batch batch;
711− renderSolidCube(batch, size, color);
712− gpu::GLBackend::renderBatch(batch);
713−}
714−
715685 void GeometryCache::renderSolidCube(gpu::Batch& batch, float size, const glm::vec4& color) {
716686 Vec2Pair colorKey(glm::vec2(color.x, color.y), glm::vec2(color.z, color.y));
717687 const int FLOATS_PER_VERTEX = 3;
@@ -833,12 +803,6 @@ void GeometryCache::renderSolidCube(gpu::Batch& batch, float size, const glm::ve · 115 unmodified lines
833803 batch.drawIndexed(gpu::TRIANGLES, indices);
834804 }
835805
836−void GeometryCache::renderWireCube(float size, const glm::vec4& color) {
837− gpu::Batch batch;
838− renderWireCube(batch, size, color);
839− gpu::GLBackend::renderBatch(batch);
840−}
841−
842806 void GeometryCache::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) {
843807 Vec2Pair colorKey(glm::vec2(color.x, color.y),glm::vec2(color.z, color.y));
844808 const int FLOATS_PER_VERTEX = 3;
@@ -922,12 +886,6 @@ void GeometryCache::renderWireCube(gpu::Batch& batch, float size, const glm::vec · 77 unmodified lines
922886 batch.drawIndexed(gpu::LINES, indices);
923887 }
924888
925−void GeometryCache::renderBevelCornersRect(int x, int y, int width, int height, int bevelDistance, const glm::vec4& color, int id) {
926− gpu::Batch batch;
927− renderBevelCornersRect(batch, x, y, width, height, bevelDistance, color, id);
928− gpu::GLBackend::renderBatch(batch);
929−}
930−
931889 void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int width, int height, int bevelDistance, const glm::vec4& color, int id) {
932890 bool registered = (id != UNKNOWN_ID);
933891 Vec3Pair key(glm::vec3(x, y, 0.0f), glm::vec3(width, height, bevelDistance));
@@ -1029,12 +987,6 @@ void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int · 95 unmodified lines
1029987 batch.draw(gpu::TRIANGLE_STRIP, details.vertices, 0);
1030988 }
1031989
1032−void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxCorner, const glm::vec4& color, int id) {
1033− gpu::Batch batch;
1034− renderQuad(batch, minCorner, maxCorner, color, id);
1035− gpu::GLBackend::renderBatch(batch);
1036−}
1037−
1038990 void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner, const glm::vec4& color, int id) {
1039991 bool registered = (id != UNKNOWN_ID);
1040992 Vec4Pair key(glm::vec4(minCorner.x, minCorner.y, maxCorner.x, maxCorner.y), color);
@@ -1111,12 +1063,6 @@ void GeometryCache::renderUnitCube(gpu::Batch& batch) { · 70 unmodified lines
11111063 renderSolidCube(batch, 1, color);
11121064 }
11131065
1114−void GeometryCache::renderUnitQuad(const glm::vec4& color, int id) {
1115− gpu::Batch batch;
1116− renderUnitQuad(batch, color, id);
1117− gpu::GLBackend::renderBatch(batch);
1118−}
1119−
11201066 void GeometryCache::renderUnitQuad(gpu::Batch& batch, const glm::vec4& color, int id) {
11211067 static const glm::vec2 topLeft(-1, 1);
11221068 static const glm::vec2 bottomRight(1, -1);
@@ -1126,14 +1072,6 @@ void GeometryCache::renderUnitQuad(gpu::Batch& batch, const glm::vec4& color, in · 3 unmodified lines
11261072 }
11271073
11281074
1129−void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxCorner,
1130− const glm::vec2& texCoordMinCorner, const glm::vec2& texCoordMaxCorner,
1131− const glm::vec4& color, int id) {
1132− gpu::Batch batch;
1133− renderQuad(batch, minCorner, maxCorner, texCoordMinCorner, texCoordMaxCorner, color, id);
1134− gpu::GLBackend::renderBatch(batch);
1135−}
1136−
11371075 void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner,
11381076 const glm::vec2& texCoordMinCorner, const glm::vec2& texCoordMaxCorner,
11391077 const glm::vec4& color, int id) {
@@ -1214,12 +1152,6 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, co · 74 unmodified lines
12141152 batch.draw(gpu::QUADS, 4, 0);
12151153 }
12161154
1217−void GeometryCache::renderQuad(const glm::vec3& minCorner, const glm::vec3& maxCorner, const glm::vec4& color, int id) {
1218− gpu::Batch batch;
1219− renderQuad(batch, minCorner, maxCorner, color, id);
1220− gpu::GLBackend::renderBatch(batch);
1221−}
1222−
12231155 void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& minCorner, const glm::vec3& maxCorner, const glm::vec4& color, int id) {
12241156 bool registered = (id != UNKNOWN_ID);
12251157 Vec3PairVec4 key(Vec3Pair(minCorner, maxCorner), color);
@@ -1291,17 +1223,6 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& minCorner, co · 65 unmodified lines
12911223 batch.draw(gpu::QUADS, 4, 0);
12921224 }
12931225
1294−void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottomLeft,
1295− const glm::vec3& bottomRight, const glm::vec3& topRight,
1296− const glm::vec2& texCoordTopLeft, const glm::vec2& texCoordBottomLeft,
1297− const glm::vec2& texCoordBottomRight, const glm::vec2& texCoordTopRight,
1298− const glm::vec4& color, int id) {
1299− gpu::Batch batch;
1300− renderQuad(batch, topLeft, bottomLeft, bottomRight, topRight, texCoordTopLeft, texCoordBottomLeft,
1301− texCoordBottomRight, texCoordTopRight, color, id);
1302− gpu::GLBackend::renderBatch(batch);
1303−}
1304−
13051226 void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& topLeft, const glm::vec3& bottomLeft,
13061227 const glm::vec3& bottomRight, const glm::vec3& topRight,
13071228 const glm::vec2& texCoordTopLeft, const glm::vec2& texCoordBottomLeft,
@@ -1395,12 +1316,6 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& topLeft, cons · 87 unmodified lines
13951316 batch.draw(gpu::QUADS, 4, 0);
13961317 }
13971318
1398−void GeometryCache::renderDashedLine(const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id) {
1399− gpu::Batch batch;
1400− renderDashedLine(batch, start, end, color, id);
1401− gpu::GLBackend::renderBatch(batch);
1402−}
1403−
14041319 void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id) {
14051320 bool registered = (id != UNKNOWN_ID);
14061321 Vec3PairVec2Pair key(Vec3Pair(start, end), Vec2Pair(glm::vec2(color.x, color.y), glm::vec2(color.z, color.w)));
@@ -1555,13 +1470,6 @@ void GeometryCache::BatchItemDetails::clear() { · 148 unmodified lines
15551470 stream.reset();
15561471 }
15571472
1558−void GeometryCache::renderLine(const glm::vec3& p1, const glm::vec3& p2,
1559− const glm::vec4& color1, const glm::vec4& color2, int id) {
1560− gpu::Batch batch;
1561− renderLine(batch, p1, p2, color1, color2, id);
1562− gpu::GLBackend::renderBatch(batch);
1563−}
1564−
15651473 void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm::vec3& p2,
15661474 const glm::vec4& color1, const glm::vec4& color2, int id) {
15671475
@@ -1646,12 +1554,6 @@ void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm · 78 unmodified lines
16461554 batch.draw(gpu::LINES, 2, 0);
16471555 }
16481556
1649−void GeometryCache::renderLine(const glm::vec2& p1, const glm::vec2& p2, const glm::vec4& color1, const glm::vec4& color2, int id) {
1650− gpu::Batch batch;
1651− renderLine(batch, p1, p2, color1, color2, id);
1652− gpu::GLBackend::renderBatch(batch);
1653−}
1654−
16551557 void GeometryCache::renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2,
16561558 const glm::vec4& color1, const glm::vec4& color2, int id) {
16571559