public Direct2DRenderTarget(DeviceContext10_1 deviceContext10, Surface surface, Format format = Format.B8G8R8A8_UNorm)
 {
     m_deviceContext10 = deviceContext10;
     m_surface = surface;
     m_format = format;
     InitializeResources(surface);
 }
Пример #2
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);
        }
Пример #3
0
 public Composer(DeviceContext10_1 deviceContext)
 {
     m_drawStateManagement = new DrawStateManagement();
     m_spriteRenderer = new SpriteRenderer(deviceContext.Device, MAX_SPRITE_INSTANCES);
 }