1
0
mirror of synced 2025-02-07 23:21:22 +01:00
2019-04-07 17:14:55 -04:00

43 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using Switch_Toolbox.Library;
namespace Switch_Toolbox.Library.Forms
{
public class GLControl2D : GLControl
{
private void InitializeComponent()
{
this.SuspendLayout();
//
// GLControl2D
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.Name = "GLControl2D";
this.Paint += new System.Windows.Forms.PaintEventHandler(this.GLControl2D_Paint);
this.ResumeLayout(false);
}
private void GLControl2D_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
if (Runtime.OpenTKInitialized == false)
return;
MakeCurrent();
GL.ClearColor(System.Drawing.Color.FromArgb(40, 40, 40));
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.Disable(EnableCap.Texture2D);
SwapBuffers();
}
}
}