예제 #1
0
        void ConstBuffer::VInit(uint byteSize, void* data) 
        {
            m_byteSize = byteSize;

            D3D11_BUFFER_DESC bDesc;
            bDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
            bDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
            bDesc.ByteWidth = byteSize;
            bDesc.Usage = D3D11_USAGE_DYNAMIC;
            bDesc.MiscFlags = 0;
            bDesc.StructureByteStride = 0;
            D3D_SAVE_CALL(chimera::d3d::GetDevice()->CreateBuffer(&bDesc, NULL, &m_buffer));

            if(data)
            {
                VSetData(data);
            }
        }
예제 #2
0
 bool DXShader::SetMatrix4x4(std::string name, const DirectX::XMFLOAT4X4 data)
 {
     return VSetData(name, &data, sizeof(float) * 16);
 }
예제 #3
0
 bool DXShader::VSetMatrix4x4(std::string name, const float data[16])
 {
     return VSetData(name, static_cast<void*>(&data), sizeof(float) * 16);
 }
예제 #4
0
 bool DXShader::SetFloat4(std::string name, const DirectX::XMFLOAT4 data)
 {
     return VSetData(name, &data, sizeof(float) * 4);
 }
예제 #5
0
 bool DXShader::VSetFloat4(std::string name, const float data[4])
 {
     return VSetData(name, static_cast<void*>(&data), sizeof(float) * 4);
 }
예제 #6
0
 bool DXShader::VSetFloat(std::string name, float data)
 {
     return VSetData(name, static_cast<void*>(&data), sizeof(float));
 }
예제 #7
0
 bool DXShader::VSetInt(std::string name, int data)
 {
     return VSetData(name, static_cast<void*>(&data), sizeof(int));
 }
예제 #8
0
 void ConstBuffer::VSetFromMatrix(const util::Mat4& mat)
 {
     VSetData((void*)&mat.m_m);
 }