/**
    Copyright (c) 2010 yakiimo02
    Distributed under the New BSD License.
    See included license.txt or http://www.yakiimo3d.com/NewBSDLicense.txt
**/

#pragma once

#include "SDKmesh.h"

class CBaseCamera;
struct CameraInfo;

/**
    @brief   Manages the creation, destruction and rendering of the scene mesh.
    @author  yakiimo02
    @date    2010/09/24
*/
class SceneMgr
{
public:
    SceneMgr();
    ~SceneMgr();
    
    HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
    void OnDestroyDevice();
    void OnRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, const CBaseCamera* pCamera, const CameraInfo& cameraInfo );

protected:
    // mesh
    CDXUTSDKMesh                m_mesh;
    // geometry
    ID3D11InputLayout*          m_pVertexLayout;
    // shader
    ID3D11VertexShader*          m_pVS;
    ID3D11PixelShader*          m_pPS;
    // buffer
    ID3D11Buffer*               m_pConstantBuf;              // Constant buffer D3D object
    // sampler state
    ID3D11SamplerState*         m_pSampleStateLinear;        // 
};

extern SceneMgr    g_sceneMgr;
