| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#ifndef JPH_DEBUG_RENDERER |
| 8 |
#error This file should only be included when JPH_DEBUG_RENDERER is defined |
| 9 |
#endif |
| 10 |
|
| 11 |
#include <Jolt/Renderer/DebugRendererRecorder.h> |
| 12 |
#include <Jolt/Core/StreamIn.h> |
| 13 |
#include <Jolt/Core/UnorderedMap.h> |
| 14 |
|
| 15 |
JPH_NAMESPACE_BEGIN |
| 16 |
|
| 17 |
|
| 18 |
class JPH_DEBUG_RENDERER_EXPORT DebugRendererPlayback |
| 19 |
{ |
| 20 |
public: |
| 21 |
|
| 22 |
DebugRendererPlayback(DebugRenderer &inRenderer) : mRenderer(inRenderer) { } |
| 23 |
|
| 24 |
|
| 25 |
void Parse(StreamIn &inStream); |
| 26 |
|
| 27 |
|
| 28 |
uint GetNumFrames() const { return (uint)mFrames.size(); } |
| 29 |
|
| 30 |
|
| 31 |
void DrawFrame(uint inFrameNumber) const; |
| 32 |
|
| 33 |
private: |
| 34 |
|
| 35 |
DebugRenderer & mRenderer; |
| 36 |
|
| 37 |
|
| 38 |
UnorderedMap<uint32, DebugRenderer::Batch> mBatches; |
| 39 |
|
| 40 |
|
| 41 |
UnorderedMap<uint32, DebugRenderer::GeometryRef> mGeometries; |
| 42 |
|
| 43 |
|
| 44 |
using Frame = DebugRendererRecorder::Frame; |
| 45 |
Array<Frame> mFrames; |
| 46 |
}; |
| 47 |
|
| 48 |
JPH_NAMESPACE_END |