Game Development Reference
In-Depth Information
bd.Usage = ResourceUsage.Default;
bd.BindFlags = BindFlags.ConstantBuffer;
bd.CpuAccessFlags = CpuAccessFlags.None;
bd.SizeInBytes = 64;
// Create the changes on resize buffer.
m_CbChangesOnResize = new
SlimDX.Direct3D11.Buffer(m_Device,bd);// Create
the changes per frame buffer.
m_CbChangesPerFrame = new
SlimDX.Direct3D11.Buffer(m_Device,bd);
// Create the changes per object buffer.
m_CbChangesPerObject = new
SlimDX.Direct3D11.Buffer(m_Device,bd);
// Send the Projection matrix into the
changes on resize constant buffer.
m_DataStream = new DataStream(64, true,
true);
m_DataStream.Position = 0;
m_DataStream.Write(Matrix.Transpose(m_ProjectionMatrix));
m_DataStream.Position = 0;
m_Device.ImmediateContext.UpdateSubresource(new
DataBox(0, 0,
m_DataStream),m_CbChangesOnResize,0);
// Send the View matrix into the changes
per frame buffer.
m_DataStream.Position = 0;
m_DataStream.Write(Matrix.Transpose(m_ViewMatrix));
m_DataStream.Position = 0;
m_Device.ImmediateContext.UpdateSubresource(new
DataBox(0, 0,
m_DataStream),m_CbChangesPerFrame,0);
Search WWH ::




Custom Search