コード例 #1
0
        private void InitializeDeviceResources()
        {
            var deviceSettings = new DeviceSettings10_1();
            
            /* Direct2D needs BgraSupport support flag to be set */
            deviceSettings.CreationFlags = DeviceCreationFlags.BgraSupport;

            /* Creates the new device */
            DeviceContext = new DeviceContext10_1(deviceSettings);

            /* Instantiate our composer */
            m_composer = new Composer(DeviceContext);

            /* Make sure we can create pixel shader effects... */
            m_shaderRenderer = new ShaderRenderer(this);

            /* Make sure we can create resources :) */
            m_resources = new ResourceFactory(this);
        }
コード例 #2
0
        public void Dispose()
        {
            if (m_composer != null)
            {
                m_composer.Dispose();
                m_composer = null;
            }

            if(m_shaderRenderer != null)
            {
                m_shaderRenderer.Dispose();
            }

            if (m_resources != null)
            {
                m_resources.Dispose();
                m_resources = null;
            }
        }