public TextureContent GetTexture() { GLDebug.CheckAccess(); framePixels = framePixels ?? new byte[Width * Height * 4]; GL.ReadPixels(0, 0, Width, Height, PixelFormat.Bgra, PixelType.UnsignedByte, framePixels); return(new TextureContent(Width, Height, framePixels)); }
public bool BeginFrame() { GLDebug.CheckAccess(); window.ProcessEvents(); if (window.IsExiting) { return(false); } GL.Viewport(0, 0, Width, Height); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); return(true); }
public GraphicsHost(GameWindow window, bool hidden = false) { if (window == null) { throw new ArgumentNullException(nameof(window)); } GLDebug.CheckAccess(); this.window = window; if (!hidden) { this.window.Visible = true; } GL.ClearColor(System.Drawing.Color.CornflowerBlue); }
public void Dispose() { GLDebug.CheckAccess(); window?.Dispose(); }
public void EndFrame() { GLDebug.CheckAccess(); window?.SwapBuffers(); }