emdlg71's picture

Rendering problem on user control that embed a GLControl

I was able to use a GLControl inside a windows Form as indicated in the tutorial on this site.
Moving the same code inside a user control and using this new user control inside a winform I was not able to see any rendering except the one at the initialization phase (Backgroud color)

I tried to derive the user control directly from GLControl too, but i had the same problems.

I had no exception and the data are correctly generated (I saved on a file the results of the texture to display) but seems that is rendering occurs even using the commands MakeCurrent on each function call of the user control.

Any suggestions or is wrong trying to use a GLControl inside a UserControl

Thank you


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

When you say "Moving the same code inside a user control" what exactly did you do? What parameters did you pass to MakeCurrent? Can you show some code?

Keep in mind that OpenGL commands are bound to an OpenGL context, not a window. What's more, the Windows platform requires that MakeCurrent is only called on device contexts that have been setup for OpenGL rendering. In WinForms, this means GLControl or anything derived from that.