Sleeping Wombat GUI  0.100
swGUI
MockRenderer.h
Go to the documentation of this file.
1 #pragma once
2 
16 
17 class MockRenderer;
18 typedef MockRenderer Renderer;
19 
20 
21 
22 
23 // @todo There're constants in ConstantsBuffersFormats.h file. This is duplicate, but there's no way to do this :(.
24 #define CAMERA_BUFFER_BINDING_POINT 0
25 #define LIGHTS_BUFFER_BINDING_POINT 1
26 #define TRANSFORM_BUFFER_BINDING_POINT 1
27 #define BONES_BUFFER_BINDING_POINT 2
28 #define MATERIAL_BUFFER_BINDING_POINT 2
29 
30 
31 
32 namespace sw
33 {
34 
35 
38 class MockRenderer : public IRenderer
39 {
40 private:
41 
42  bool m_valid;
44 public:
46  ~MockRenderer();
47 
48  bool SupportsDefferedContextRendering() override { return true; }
49  bool IsValid() override { return m_valid; }
50 
51 
52 
53 
54  virtual void Draw ( const DrawCommand& command ) override;
55  virtual void DrawInstanced ( const DrawInstancedCommand& command ) override;
56 
57  virtual void SetRenderTarget ( const SetRenderTargetCommand& command ) override;
58  virtual void SetRenderTarget ( const SetRenderTargetExCommand& command ) override;
59  virtual void ClearRenderTarget ( const ClearRenderTargetCommand& command ) override;
60 
61  virtual void UpdateBuffer ( const UpdateBufferCommand& command ) override;
62  virtual void BindBuffer ( const BindBufferCommand& command ) override;
63  virtual void UpdateAndBindBuffer ( const UpdateBindBuffer& command ) override;
64 
65  virtual void SetDefaultBuffers ( const SetDefaultBuffersCommand& command ) override;
66 
67  virtual void SetShaderState ( const SetShaderStateCommand& command ) override;
68  virtual void SetShaderState ( const SetShaderStateExCommand& command ) override;
69  virtual void SetShaderState ( const SetRenderStateCommand& command ) override;
70  virtual void SetShaderState ( const SetRenderStateExCommand& command ) override;
71 
72  virtual void CopyTexture ( const CopyTextureCommand& command ) override;
73 
74 private:
75 
76  bool SetVertexBuffer ( BufferObject* buffer, unsigned int offset );
77  void SetIndexBuffer ( BufferObject* buffer, unsigned int offset, bool extendedIndex );
78  void SetRenderTarget ( RenderTargetObject* const targets[ MAX_BOUND_RENDER_TARGETS ], RenderTargetObject* depthStencil );
79  void SetTextures ( TextureObject* const texturesArray[ MAX_BOUND_RENDER_TARGETS ], const uint8 shaderTypes[ MAX_BOUND_RENDER_TARGETS ] );
80 };
81 
82 } // sw
83 
84 
virtual void CopyTexture(const CopyTextureCommand &command) override
Definition: MockRenderer.cpp:122
bool SupportsDefferedContextRendering() override
Informuje czy Renderer nadaje się do renderowania w wielu wątkach do opóźnionego contextu.
Definition: MockRenderer.h:48
Copy texture.
Definition: RenderCommands.h:183
Sets basic shaders and textures.
Definition: RenderCommands.h:136
virtual void ClearRenderTarget(const ClearRenderTargetCommand &command) override
Definition: MockRenderer.cpp:77
bool SetVertexBuffer(BufferObject *buffer, unsigned int offset)
Definition: MockRenderer.cpp:133
Obiekt opakowujący bufor.Bufor może być zarówno buforem wierzchołków, indeksów jak i stałych...
Definition: MeshResources.h:516
Set state of rasterizer and render target.
Definition: RenderCommands.h:36
virtual void SetRenderTarget(const SetRenderTargetCommand &command) override
Definition: MockRenderer.cpp:67
Sets geometry and tesselation shaders.
Definition: RenderCommands.h:148
Mock renderer for debugging and testing.
Definition: MockRenderer.h:38
Renderowanie natychmiastowe.
Definition: IRenderer.h:21
Set state of rasterizer and render target.
Definition: RenderCommands.h:94
Definition: DirectInputModule.cpp:11
virtual void BindBuffer(const BindBufferCommand &command) override
Definition: MockRenderer.cpp:87
Klasa interfejsu renderera.
Definition: IRenderer.h:29
RendererUsage m_usageType
Informacja jak będzie używany rederer.
Definition: MockRenderer.h:43
bool IsValid() override
Definition: MockRenderer.h:49
Main draw command.
Definition: RenderCommands.h:109
#define MAX_BOUND_RENDER_TARGETS
Definition: RenderCommands.h:19
virtual void DrawInstanced(const DrawInstancedCommand &command) override
Definition: MockRenderer.cpp:58
bool m_valid
Jeżeli klasa nie została zainicjowana poprawnie, to będzie tu wartość false.
Definition: MockRenderer.h:42
Definition: RenderCommands.h:169
RendererUsage
Sposób użycia renderera.
Definition: IRenderer.h:18
void SetIndexBuffer(BufferObject *buffer, unsigned int offset, bool extendedIndex)
Definition: MockRenderer.cpp:150
Binds buffer to pipeline and updates with given data.
Definition: RenderCommands.h:218
Plik zawiera deklaracje formatów wierzchołków oraz klas zawierających assety shadery itp...
Updates buffer with given data.
Definition: RenderCommands.h:207
~MockRenderer()
Definition: MockRenderer.cpp:42
Sets default buffers.
Definition: RenderCommands.h:159
Binds additional buffers.
Definition: RenderCommands.h:196
Instanced drawing command.
Definition: RenderCommands.h:124
Klasa przechowująca tekstury.Klasa bazowa, która będzie używana przez obiekty silnika. Powinny po niej odziedziczyć obiekty konkretnego API graficznego, żeby zaimplementować najważniejsze funkcjonalności.
Definition: MeshResources.h:206
Definition: RenderCommands.h:176
uint8_t uint8
Definition: TypesDefinitions.h:27
Set state of rasterizer and render target.
Definition: RenderCommands.h:82
void SetTextures(TextureObject *const texturesArray[MAX_BOUND_RENDER_TARGETS], const uint8 shaderTypes[MAX_BOUND_RENDER_TARGETS])
Definition: MockRenderer.cpp:160
MockRenderer Renderer
Definition: MockRenderer.h:17
virtual void SetShaderState(const SetShaderStateCommand &command) override
Definition: MockRenderer.cpp:102
Klasa dla render targetów.Klasa umożliwia pobranie jednej z tekstur składowych i udostępnienie dla sh...
Definition: MeshResources.h:301
virtual void Draw(const DrawCommand &command) override
Definition: MockRenderer.cpp:53
MockRenderer(RendererUsage usage=USE_AS_IMMEDIATE)
Definition: MockRenderer.cpp:35
virtual void UpdateBuffer(const UpdateBufferCommand &command) override
Definition: MockRenderer.cpp:82
virtual void SetDefaultBuffers(const SetDefaultBuffersCommand &command) override
Definition: MockRenderer.cpp:97
virtual void UpdateAndBindBuffer(const UpdateBindBuffer &command) override
Definition: MockRenderer.cpp:92