#ifndef __D3DDepthStencilBuffer__
#define __D3DDepthStencilBuffer__

#include <windows.h>
#include <d3d10_1.h>
#include <d3dx10.h>
#include <dxgi.h>

#include "../Core/SceneGraph/DepthStencilBuffer.h"
#include "D3DDefs.h"

class D3DDepthStencilBuffer : public DepthStencilBuffer {
public:
    D3DDepthStencilBuffer(uint32 width, uint32 height, uint32 sampleCount, ID3D10Device1* device);
    virtual ~D3DDepthStencilBuffer();

    void resize(uint32 width, uint32 height);

    ID3D10DepthStencilView* getDepthStencilView();

protected:
    HRESULT createSurface(ID3D10Texture2D** ppTexture, ID3D10DepthStencilView** ppTextureDSV, DXGI_FORMAT format, uint32 sampleCount, uint32 width, uint32 height);

    ID3D10Device1*              _device;

    ID3D10Texture2D*            _depthStencil;
    ID3D10DepthStencilView*     _depthStencilView;
};

#endif