Game Development Reference
In-Depth Information
protected:
DWORD
m_numVerts;
DWORD
m_sides;
const char *
m_textureBaseName;
shared_ptr<CameraNode>
m_camera;
bool
m_bActive;
ID3D11Buffer*
m_pIndexBuffer;
ID3D11Buffer*
m_pVertexBuffer;
GameCode4_Hlsl_VertexShader m_VertexShader;
GameCode4_Hlsl_PixelShader m_PixelShader;
public:
D3DSkyNode11(const char *textureFile, shared_ptr<CameraNode> camera);
virtual ~ D3DSkyNode11 ();
HRESULT VOnRestore(Scene *pScene);
HRESULT VRender(Scene *pScene);
HRESULT VPreRender(Scene *pScene);
bool VIsVisible(Scene *pScene) const { return m_bActive; }
};
This class makes use of the vertex and pixel shader classes you learned about in the
previous chapter. The constructor and destructor are fairly simple. Note that the text
string sent into the pixel shader constructor is empty
that
'
s because the sky node is
going to do something a little special.
D3DSkyNode11::D3DSkyNode11 (const char *pTextureBaseName,
shared_ptr<CameraNode> camera)
: SceneNode(INVALID_ACTOR_ID
Sky
, RenderPass_Sky, g_White,
&Mat4x4::g_Identity)
, m_camera(camera)
, m_bActive(true)
, m_PixelShader(
““
)
{
m_textureBaseName = pTextureBaseName;
m_pVertexBuffer = NULL;
m_pIndexBuffer = NULL;
m_PixelShader.EnableLights(false);
}
D3DSkyNode11::~D3DSkyNode11 ()
{
SAFE_RELEASE(m_pVertexBuffer);
SAFE_RELEASE(m_pIndexBuffer);
}
Search WWH ::




Custom Search