GLControl does not redraw in Visual Studio [resolved]
Posted Wednesday, 9 July, 2008 - 17:17 by oyvindra in
I am using Visual Studio 2005 and 2008 Express with OpenTK 0.9.1, GLControl does not redraw when editing, which can make the form look more than a little confusing when switching between the code and form view.
I don't know if this has been fixed in some later release,.





Comments
Jul 09
21:51:43Re: GLControl does not redraw in Visual Studio
posted by georgwaechterthis is because OpenTK doesn't create a rendering context in design mode.
Suggestion: Simply draw the box with a grey background with GDI when in design mode.
Jul 10
14:13:00Re: GLControl does not redraw in Visual Studio
posted by the FiddlerThis was a regression that resurfaced at some point between 0.9.0 and 0.9.1. Check the current SVN for a fix (the background is redrawn using the control's BackColor).
It is true that OpenTK does not create a real OpenGL context when in design mode (there is something called DummyGLContext to get around issues like this). Earlier versions actually did try to create an OpenGL context, only to cause VS to go up in flames - at some point, I saw VS allocate 1.2GB of memory before crashing with an "internal error". It might be possible to get OpenGL-in-design-mode to work, but I don't really think it's worth the effort.
If someone wishes to have some fun, just comment out the
if (DesignMode)line in GLControl.cs:91. :D