I have been using the GLU tesselator implementation of OpenTK for a while now, and I have been experiencing some strange problems. Every once in a while, the tesselation results are visually... chaotic. It seems that a triangle or two is returning with the wrong vertices. Sorry I do not have any screenshots at the moment, but I will try and get some when it goes haywire again.
What is really strange about it is that it only seems to do this the first run after a compilation. I does not happen every time, but that is the only thing I have seen in common with when it screws up and when it doesn't.
There are only a few guesses that I have. First of all, I am simply creating a new GLControl right before I use the tesselator. So it might be possible that the context does not exist before I start tesselating. Since I am just creating a new control in code and not using it, how would I test to see if the context is active? The construction and initialization of the GLControl seems to be asynchronous (I am not sure about this though), is this true? Is there any other, more simpler way to get a GL context to keep the tesselator alive?
The only other thing I can think of is that it is some strange artifact of the JIT.
Can anyone think of what might be going on here?