[英]How to run OpenTk in Vs 2008?
i try to learn OpenTk (Old Version Tao Framework) But i can not simple draw Line : 我尝试学习OpenTk(旧版Tao框架),但我不能简单地画出Line:
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Audio;
using OpenTK.Audio.OpenAL;
using OpenTK.Input;
namespace Test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void glControl1_Paint(object sender, PaintEventArgs e)
{
// COORDINATE SYSTEM ALGORITHM:
GL.ClearColor(1.0f, 1.0f, 1.0f, 1.0f);
GL.ShadeModel(ShadingModel.Flat);
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
glControl1.SwapBuffers();
GL.Begin(BeginMode.Lines);
GL.Vertex2(0.0, -1.0);
GL.Vertex2(0.0, 1.0);
GL.Vertex2(1.0, 0.0);
GL.Vertex2(-1.0, 0.0);
GL.End();
}
}
}
i can not watch coordinate system. 我看不到坐标系。 i think that can not run open tk in vs 2008?
我认为无法在vs 2008中运行open tk? what is your best advise?
您最好的建议是什么?
Several things : 几件事:
It will run in VS2008. 它将在VS2008中运行。
There's some good OpenTK starting code here that walks you through proper setup of a Winform + GLControl and some simple rendering. 这里有一些不错的OpenTK起始代码,可指导您正确设置Winform + GLControl和一些简单的呈现。 (It should be enough to let you sort out the various issues Calvin pointed out.)
(足以让您理清卡尔文指出的各种问题。)
http://www.opentk.com/doc/chapter/2/glcontrol http://www.opentk.com/doc/chapter/2/glcontrol
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.