Я пытаюсь выполнить следующий код:
static void Main(string[] args)
{
int Width = 512, Height = 512; //window size
var CubeSize = 200; // square size
int left, right, top, bottom;
left = (Width - CubeSize) / 2;
right = left + CubeSize;
bottom = (Height - CubeSize) / 2;
top = bottom + CubeSize;
GL.ClearColor(0, 0, 0, 1);
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.Color3(255, 0, 0);
GL.Begin(BeginMode.Quads);
GL.Vertex2(left, bottom);
GL.Vertex2(left, top);
GL.Vertex2(right, top);
GL.Vertex2(right, bottom);
GL.End();
}
В строке GL.ClearColor
выдается ошибка:
Попытка чтения или записи в защищенную память
Нужна помощь.