natt's picture

OpenTK and angleproject

I'm trying to do a simple OpenTK example using OpenGL ES 2.0 as provided by the angleproject on Windows, but nothing seems to be working right. I can't even get a GameWindow to show up. I have libEGL.dll and libGLESv2.dll in the same folder as my binaries. Here's my code:

[STAThread]
static void Main()
{
	try
	{
 
		var gw = new GameWindow(200, 200, GraphicsMode.Default, "Test", GameWindowFlags.Default, DisplayDevice.Default,
			2, 0, GraphicsContextFlags.Embedded);
 
		gw.Run();
	}
	catch (Exception e)
	{
		Clipboard.SetText(e.ToString());
		MessageBox.Show(e.ToString());
	}
}

The exception is:

OpenTK.Graphics.GraphicsContextException: Exception of type 'OpenTK.Graphics.GraphicsContextException' was thrown.
   at OpenTK.Graphics.GraphicsContext.LoadAll() in D:\encodes\opentk\Source\OpenTK\Graphics\GraphicsContext.cs:line 513
   at OpenTK.GameWindow..ctor(Int32 width, Int32 height, GraphicsMode mode, String title, GameWindowFlags options, DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) in D:\encodes\opentk\Source\OpenTK\GameWindow.cs:line 220
   at OpenTK.GameWindow..ctor(Int32 width, Int32 height, GraphicsMode mode, String title, GameWindowFlags options, DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags) in D:\encodes\opentk\Source\OpenTK\GameWindow.cs:line 180
   at EGLTest.Program.Main() in D:\encodes\EGLTest\Program.cs:line 21