Reputation: 2966
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?
Upvotes: 0
Views: 941
Reputation: 4458
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.)
http://www.opentk.com/doc/chapter/2/glcontrol
Upvotes: 0
Reputation: 9547
Several things :
Upvotes: 1