Beispiel #1
0
        public void SurfaceChanged(ISurfaceHolder holder, Format format, int w, int h)
        {
            log("SurfaceChanged");

            callMakeCurrent = true;

            Width  = w;
            Height = h;

            // Surface size or format has changed
            surfaceRect = holder.SurfaceFrame;
            size        = new Size(surfaceRect.Right - surfaceRect.Left, surfaceRect.Bottom - surfaceRect.Top);

            if (OpenTK.Graphics.GraphicsContext.CurrentContextHandle.Handle != IntPtr.Zero && RenderOnUIThread)
            {
                GLCalls.Viewport(0, 0, size.Width, size.Height);
                GLCalls.Scissor(0, 0, size.Width, size.Height);
            }

            OnResize(EventArgs.Empty);
        }