예제 #1
0
        public void Cleanup()
        {
            m_DeviceContext.PixelShader.Set(null);
            m_DeviceContext.VertexShader.Set(null);

            m_SwapChain.Dispose();
            m_SwapChain = null;

            Device.Dispose();
            Device = null;

            m_DeviceContext.Dispose();
            m_DeviceContext = null;

            //--------

            m_ShaderMgr.Dispose();
            m_ShaderMgr = null;

            m_TextureMgr.Dispose();
            m_TextureMgr = null;

            m_TriMeshMgr.Dispose();
            m_TriMeshMgr = null;
        }
예제 #2
0
        public void Init(Form window)
        {
            m_Window = window;

            InitDevice(m_NumSamples);
            InitShaders();

            m_TextureMgr = new SharpDXTextureMgr(this);
            m_TriMeshMgr = new SharpDXTriMeshMgr(this);

            var desc = new D3D11.BufferDescription(64, D3D11.ResourceUsage.Default, D3D11.BindFlags.ConstantBuffer, D3D11.CpuAccessFlags.None, D3D11.ResourceOptionFlags.None, 0);
            var o    = Matrix4x4.Identity();

            m_ShaderParams = D3D11.Buffer.Create(Device, ref o, desc);
            m_DeviceContext.VertexShader.SetConstantBuffer(0, m_ShaderParams);

            m_Quad = m_TriMeshMgr.CreateQuad(2.0f, 2.0f);
        }