예제 #1
0
파일: Widget.cs 프로젝트: Mokarski/Vagonka
        protected void Resize(int width, int height)
        {
            if (Width == width && Height == height)
            {
                return;
            }

            if (width != 0)
            {
                Width = width;
            }

            if (height != 0)
            {
                Height = height;
            }

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

            if (Width == 0 || Height == 0)
            {
                return;
            }

            mRenderBuffer = new RenderBuffer(Width, Height, PixelFormat);
            Invalidate();
        }
예제 #2
0
        void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    RenderBuffer?.Dispose();
                    renderBufferColorRects?.Dispose();
                    if (Texture is Texture texture)
                    {
                        texture?.Dispose();
                    }
                    Visible = false;

                    disposed = true;
                }
            }
        }
예제 #3
0
 void IDisposable.Dispose()
 {
     Texture.Dispose();
     GL.DeleteFramebuffers(1, ref _fboHandle);
     _depth.Dispose();
 }