| 144 | } |
| 145 | |
| 146 | void SpriteRenderer::Render(ID3D12GraphicsCommandList* cmdList, const Texture* texture, const SpriteTransform& transform, |
| 147 | const Float4& color, const Float4* drawRect) |
| 148 | { |
| 149 | if(texture == nullptr) |
| 150 | texture = &defaultTexture; |
| 151 | |
| 152 | SpriteDrawData drawData; |
| 153 | drawData.Transform = transform; |
| 154 | drawData.Color = color; |
| 155 | if(drawRect != nullptr) |
| 156 | drawData.DrawRect = *drawRect; |
| 157 | else |
| 158 | drawData.DrawRect = Float4(0.0f, 0.0f, float(texture->Width), float(texture->Height)); |
| 159 | |
| 160 | RenderBatch(cmdList, texture, &drawData, 1); |
| 161 | } |
| 162 | |
| 163 | void SpriteRenderer::RenderBatch(ID3D12GraphicsCommandList* cmdList, const Texture* texture, |
| 164 | const SpriteDrawData* drawData, uint64 numSprites) |