private static int CreateVAO() { int vaoID; GL.GenVertexArrays(1, out vaoID); GL.BindVertexArray(vaoID); vaos.Add(vaoID); return(vaoID); }
protected override void OnRenderFrame(FrameEventArgs e) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); Scene.DrawScene(); GL.BindVertexArray(0); Context.SwapBuffers(); base.OnRenderFrame(e); }
protected override void OnUnload(EventArgs e) { GL.BindBuffer(BufferTarget.ArrayBuffer, 0); GL.BindVertexArray(0); GL.UseProgram(0); Scene.ClearHandles(); Shader?.Dispose(); LampShader?.Dispose(); base.OnUnload(e); }
private static void UnbindVAO() { GL.BindVertexArray(0); }