Пример #1
0
        public void Dispose()
        {
            _disposer.DisposeAll();
            PaletteView?.Dispose();
            PaletteTexture?.Dispose();
            CommonResourceSet?.Dispose();

            PaletteView       = null;
            PaletteTexture    = null;
            CommonResourceSet = null;
        }
Пример #2
0
        public void DestroyDeviceObjects()
        {
            _disposer.DisposeAll();
            PaletteView?.Dispose();
            PaletteTexture?.Dispose();
            CommonResourceSet?.Dispose();

            PaletteView       = null;
            PaletteTexture    = null;
            CommonResourceSet = null;
        }
Пример #3
0
        public void UpdatePerFrameResources(GraphicsDevice gd, CommandList cl)
        {
            CommonResourceSet?.Dispose();
            CommonResourceSet = gd.ResourceFactory.CreateResourceSet(new ResourceSetDescription(
                                                                         CommonResourceLayout,
                                                                         CameraInfoBuffer,
                                                                         ProjectionMatrixBuffer,
                                                                         ModelViewMatrixBuffer,
                                                                         PaletteView));

            CommonResourceSet.Name = "RS_Common";

            cl.UpdateBuffer(ProjectionMatrixBuffer, 0, Camera.ProjectionMatrix);
            cl.UpdateBuffer(ModelViewMatrixBuffer, 0, Camera.ViewMatrix);
            cl.UpdateBuffer(CameraInfoBuffer, 0, Camera.GetCameraInfo());
        }