コード例 #1
0
        public override void BindToDevice(GraphicsDevice device)
        {
            lock (syncRoot)
            {
                AssertNotDisposed();

                buffer.BindToDevice(device);

                // We now create view.
                if (view == null)
                {
                    view = device.DriverDevice.CreateRenderTargetView(buffer.DeviceData,
                                                                      UsageDimensionType.Buffer,
                                                                      format.CommonFormatLayout, offset, width, 0);
                }
            }
        }
コード例 #2
0
        public override void BindToDevice(GraphicsDevice device)
        {
            lock (syncRoot)
            {
                AssertNotDisposed();

                // We first bind underlaying (forced).
                buffer.BindToDevice(device);

                // Bind only if not bound.
                if (view == null)
                {
                    // We bind ourself.
                    view = device.DriverDevice.CreateTextureView(buffer.DeviceData,
                                                                 Driver.UsageDimensionType.Buffer, format.CommonFormatLayout,
                                                                 offset, width, 0);
                }
            }
        }