
Help getting started with GLControl
Posted Tuesday, 7 June, 2011 - 20:08 by ctartamella inI am following the docs on using GLControl with Windows forms. I am using C++/CLI though, not C#. Starting with a basic projec t (VS2010) I added OpenTK to the and GLControl to the references, and dropped a GLControl on the form. (It is the only control).
The class itself has a private boolean flag that I set to false in the constructor and switch to true in the Load event of GLControl.
I then hook in the Paint event:
System::Void glControl1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { if (!loaded) return; GL.ClearColor(0.0, 0.0, 0.0, 1.0); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit) glControl1->SwapBuffers(); }
However, both lines which make calls to GL fire syntax errors saying theres a missing ; before the .
What could I be missing? Any help is appreciated.


Comments
Re: Help getting started with GLControl
The GL class provides static methods. You need to do:
etc