Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 11 files). Show all
Unified · Split
| @@ -760,6 +760,20 @@ void GeometryCache::renderWireShape(gpu::Batch& batch, Shape shape) { · 759 unmodified lines | ||
| 760 | 760 | _shapes[shape].drawWire(batch); |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | +void GeometryCache::renderShape(gpu::Batch& batch, Shape shape, const glm::vec4& color) { | |
| 764 | + batch.setInputFormat(getSolidStreamFormat()); | |
| 765 | + // Color must be set after input format | |
| 766 | + batch._glColor4f(color.r, color.g, color.b, color.a); | |
| 767 | + _shapes[shape].draw(batch); | |
| 768 | +} | |
| 769 | + | |
| 770 | +void GeometryCache::renderWireShape(gpu::Batch& batch, Shape shape, const glm::vec4& color) { | |
| 771 | + batch.setInputFormat(getSolidStreamFormat()); | |
| 772 | + // Color must be set after input format | |
| 773 | + batch._glColor4f(color.r, color.g, color.b, color.a); | |
| 774 | + _shapes[shape].drawWire(batch); | |
| 775 | +} | |
| 776 | + | |
| 763 | 777 | void setupBatchInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer) { |
| 764 | 778 | gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT); |
| 765 | 779 | batch.setInputBuffer(gpu::Stream::COLOR, colorView); |
| @@ -811,6 +825,14 @@ void GeometryCache::renderWireCube(gpu::Batch& batch) { · 45 unmodified lines | ||
| 811 | 825 | renderWireShape(batch, Cube); |
| 812 | 826 | } |
| 813 | 827 | |
| 828 | +void GeometryCache::renderCube(gpu::Batch& batch, const glm::vec4& color) { | |
| 829 | + renderShape(batch, Cube, color); | |
| 830 | +} | |
| 831 | + | |
| 832 | +void GeometryCache::renderWireCube(gpu::Batch& batch, const glm::vec4& color) { | |
| 833 | + renderWireShape(batch, Cube, color); | |
| 834 | +} | |
| 835 | + | |
| 814 | 836 | void GeometryCache::renderSphere(gpu::Batch& batch) { |
| 815 | 837 | renderShape(batch, Sphere); |
| 816 | 838 | } |
| @@ -819,6 +841,14 @@ void GeometryCache::renderWireSphere(gpu::Batch& batch) { · 2 unmodified lines | ||
| 819 | 841 | renderWireShape(batch, Sphere); |
| 820 | 842 | } |
| 821 | 843 | |
| 844 | +void GeometryCache::renderSphere(gpu::Batch& batch, const glm::vec4& color) { | |
| 845 | + renderShape(batch, Sphere, color); | |
| 846 | +} | |
| 847 | + | |
| 848 | +void GeometryCache::renderWireSphere(gpu::Batch& batch, const glm::vec4& color) { | |
| 849 | + renderWireShape(batch, Sphere, color); | |
| 850 | +} | |
| 851 | + | |
| 822 | 852 | void GeometryCache::renderGrid(gpu::Batch& batch, const glm::vec2& minCorner, const glm::vec2& maxCorner, |
| 823 | 853 | int majorRows, int majorCols, float majorEdge, |
| 824 | 854 | int minorRows, int minorCols, float minorEdge, |