예제 #1
0
        public void Dispose()
        {
            if (renderState != null)
            {
                renderState.Dispose();
                renderState = null;
            }

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

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

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

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

            if (vertexBufferStreamer != null)
            {
                vertexBufferStreamer.Dispose();
                vertexBufferStreamer = null;
            }
        }
예제 #2
0
        public void Dispose()
        {
            if (texture != null)
            {
                texture.Dispose();
                texture = null;
            }

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

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

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

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

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

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

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

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

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