port from perforce
This commit is contained in:
81
aiwaz/Aiwaz/Resources/RenderTarget/RenderTargetBase.h
Normal file
81
aiwaz/Aiwaz/Resources/RenderTarget/RenderTargetBase.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#pragma once
|
||||
|
||||
#include "IEngine.h"
|
||||
#include "IRenderTargetBase.h"
|
||||
#include "../Commands/CommandUserBase.h"
|
||||
|
||||
|
||||
class RenderTargetBase
|
||||
: public IRenderTargetBase
|
||||
, public CommandUserBase
|
||||
{
|
||||
protected:
|
||||
static const unsigned char SetRenderTargetCommandType = 0;
|
||||
|
||||
public:
|
||||
RenderTargetBase(IEngine& argEngine);
|
||||
virtual ~RenderTargetBase();
|
||||
|
||||
virtual void set_ClearDepth(float argValue) { m_ClearDepthStencilBufferDepth = argValue; }
|
||||
virtual float get_ClearDepth() const { return m_ClearDepthStencilBufferDepth; }
|
||||
|
||||
virtual void set_ClearStencil(unsigned char argValue) { m_ClearDepthStencilBufferStencil = argValue; }
|
||||
virtual unsigned char get_ClearStencil() const { return m_ClearDepthStencilBufferStencil; }
|
||||
|
||||
virtual void set_ClearColor(const D3DXCOLOR& argValue) { m_ClearColorBufferColor = argValue; }
|
||||
virtual D3DXCOLOR get_ClearColor() const { return m_ClearColorBufferColor; }
|
||||
|
||||
virtual void set_ViewPort(const ViewPort& argValue);
|
||||
virtual ViewPort get_ViewPort() const { return m_ViewPort; }
|
||||
|
||||
virtual uint32 get_RenderTargetWidth() const = 0;
|
||||
virtual uint32 get_RenderTargetHeight() const = 0;
|
||||
virtual DataFormat::Enumeration get_RenderTargetFormat() const = 0;
|
||||
|
||||
virtual void set_HasDepthStencilBuffer(bool argState);
|
||||
virtual bool get_HasDepthStencilBuffer() const { return m_DepthStencilView != NULL; }
|
||||
|
||||
virtual void AddAdditionalRenderTarget(IRenderTargetBase& argTarget);
|
||||
virtual void RemoveAdditionalRenderTarget(IRenderTargetBase& argTarget);
|
||||
|
||||
virtual ID3D10RenderTargetView* get_DX10RenderTargetView() const { return m_RenderTargetView; }
|
||||
virtual ID3D10DepthStencilView* get_DX10DepthStencilView() const { return m_DepthStencilView; }
|
||||
|
||||
virtual void Bind(DWORD argBindFlags = BindFlags::Default);
|
||||
virtual void UnbindAllRenderTargets();
|
||||
|
||||
// ICommandUser
|
||||
virtual CommandExecuteResult::Enumeration ExecuteCommand(unsigned char argCommandType, ICommandBuffer& argCurrentBuffer, uint32 argCurrentPositon);
|
||||
|
||||
protected:
|
||||
void Clear(DWORD argBindFlags = BindFlags::Default);
|
||||
|
||||
virtual void Uninitialize();
|
||||
void BuildViewPortAndRenderTargetData();
|
||||
void KillViewPortAndRenderTargetData();
|
||||
|
||||
protected:
|
||||
IEngine& m_Engine;
|
||||
|
||||
float m_ClearDepthStencilBufferDepth;
|
||||
unsigned char m_ClearDepthStencilBufferStencil;
|
||||
D3DXCOLOR m_ClearColorBufferColor;
|
||||
|
||||
ViewPort m_ViewPort;
|
||||
|
||||
ID3D10RenderTargetView* m_RenderTargetView;
|
||||
ID3D10DepthStencilView* m_DepthStencilView;
|
||||
ID3D10Texture2D* m_DepthStencilTexture;
|
||||
|
||||
uint32 m_MultiSampleCount;
|
||||
uint32 m_MultiSampleQuality;
|
||||
|
||||
std::vector<IRenderTargetBase*> m_AdditionalRenderingTargets;
|
||||
ID3D10RenderTargetView** m_RenderingTargets;
|
||||
D3D10_VIEWPORT* m_D3D10Viewports;
|
||||
uint32 m_ActiveRenderTargetCount;
|
||||
|
||||
DWORD m_LastBindFlags;
|
||||
|
||||
ID3D10ShaderResourceView* m_EmptyShaderResView[128];
|
||||
};
|
||||
Reference in New Issue
Block a user