/// ****************************************************************************
/// @file   
/// @author Dr.Neeton
/// @date   200X/X/X - 2014/01/24
/// 
/// @brief  DirectX バッファインターフェース。
/// 
/// ****************************************************************************

#pragma once

#include "CPL_DX_Kernel.h"
#include "CPL_DX_RenderFragment.h"
#include "CPL_DX_Pipeline.h"

namespace CPL {
namespace DX {
namespace Buffer {

// _____________________________________________________________________________
/// @brief バッファインターフェース
///
// *****************************************************************************
class Interface_
  : public RenderFragment_i_
{
protected:
  Interface_(){} // 継承用

public:
  virtual ~Interface_(){}

  virtual HRESULT     Create
                        ( _in<size_t> in_element_size
                        , _in<size_t> in_element_num
                        , pin<void  > in_ptr_init_data
                        ) = 0;
  virtual HRESULT     SetData
                        ( _in<size_t> in_index
                        , pin<void  > in_ptr_data
                        , _in<size_t> in_element_num = 1
                        ) = 0;
  virtual HRESULT     GetData
                        ( _in <size_t> in_index
                        , pout<void  > out_ptr_data
                        , _in <size_t> in_element_num = 1
                        ) const = 0;
  virtual void        Release() = 0;
  virtual HRESULT     Map( pout<void_ptr> out_pp_buf
                         , _in<UINT     > in_subresource = 0
                         ) = 0;
  virtual HRESULT     Map( pout<void_cptr> out_pp_buf
                         , _in <UINT     > in_subresource = 0
                         ) const = 0;
  virtual void        Unmap() = 0;
  virtual size_t      GetElementSize() const = 0;
  virtual size_t      GetElementNum()  const = 0;
  virtual size_t      GetSize() const = 0;
  virtual Core::SStringA<64> const&
                      GetName() const = 0;
  virtual void        SetName( pin<char> in_name ) = 0;
  virtual int         GetSlotNo() const = 0;
  virtual void        SetSlotNo( _in<int> in_slot_No ) = 0;
  virtual DXBuffer const*
                      GetDxObject() const = 0;
  virtual DXBuffer*   GetDxObject() = 0;
  virtual void        SetPipeline
                        ( pin<Pipeline::Function> in_pipeline_function_list
                        , _in<int               > in_func_num
                        ) = 0;

  virtual D3D11_USAGE GetUsage()            const = 0;
  virtual UINT        GetBindFlags()        const = 0;
  virtual UINT        GetCPUAccessFlags()   const = 0;
  virtual UINT        GetMiscFlags()        const = 0;
  virtual UINT        GetSysMemPichi()      const = 0;
  virtual UINT        GetSysMemSlicePitch() const = 0;
};


} // namespace Buffer
} // namespace DX
} // namespace CPL
