Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 2 files). Show all
Unified · Split
| @@ -1179,6 +1179,21 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec2& minCorner, co · 1178 unmodified lines | ||
| 1179 | 1179 | batch.draw(gpu::QUADS, 4, 0); |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | +void GeometryCache::renderUnitQuad(const glm::vec4& color, int id) { | |
| 1183 | + gpu::Batch batch; | |
| 1184 | + renderUnitQuad(batch, color, id); | |
| 1185 | + gpu::GLBackend::renderBatch(batch); | |
| 1186 | +} | |
| 1187 | + | |
| 1188 | +void GeometryCache::renderUnitQuad(gpu::Batch& batch, const glm::vec4& color, int id) { | |
| 1189 | + static const glm::vec2 topLeft(-1, 1); | |
| 1190 | + static const glm::vec2 bottomRight(1, -1); | |
| 1191 | + static const glm::vec2 texCoordTopLeft(0.0f, 1.0f); | |
| 1192 | + static const glm::vec2 texCoordBottomRight(1.0f, 0.0f); | |
| 1193 | + renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, color, id); | |
| 1194 | +} | |
| 1195 | + | |
| 1196 | + | |
| 1182 | 1197 | void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxCorner, |
| 1183 | 1198 | const glm::vec2& texCoordMinCorner, const glm::vec2& texCoordMaxCorner, |
| 1184 | 1199 | const glm::vec4& color, int id) { |