i try to learn OpenTk (Old Version Tao Framework) But i can not simple draw 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? what is your best advise?
Several things :
It will run in VS2008.
There's some good OpenTK starting code here that walks you through proper setup of a Winform + GLControl and some simple rendering. (It should be enough to let you sort out the various issues Calvin pointed out.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.