
multiple glcontrols in one application
Posted Saturday, 9 August, 2008 - 16:10 by GhostTyper inhello,
i need to support a unlimited count of glcontrols. each glcontrol is in it's own window. (i need to open as many windows as the user wants.)
is this possible using opentk?
it seems that a second glcontrol takes some resources from the first. (the first doesn't work anymore.)
also, all GL.* functions are static global? if so, then opentk doesnt support more than one control?


Comments
Re: multiple glcontrols in one application
It is possible, and has been discussion in the forums: http://www.opentk.com/node/376.
It would be nice if there was a book page "Multiple GLControls tutorial" available :)
If you feel like contributing to OpenTK, please create such a book page after you have gotten your program to work, and document what you learnt. Typos/layout/style will be fixed collaboratively, so don't worry about such issues.
This is how: Use the "Create content"-link to the left to and click the "Book Page" link. Save the page in the "Experimental" category (last item in the content list), and Fiddler will move it appropriately and create a link to it in the menus.
Re: multiple glcontrols in one application
oh, thanks.
this was what i'm looking for.
but i dont think that a tutorial is required, cause you only need to call glControlInstance.MakeCurrent(); before any GL.* (or GlU.*) actions. that's it. quite simple!
thanks!
ps: if a tutorial is really needed the writer of "Building a Windows.Forms+GLControl based application" should name the MakeCurrent() call in the right position. maybe when he's explaining GL.Clear, cause CL.Clear needs "MakeCurrent" already, if you want to adress another Control like the last you've put on your Window.
sorry for my poor english.
Re: multiple glcontrols in one application
@GhostTyper
I've added the info to the GLControl tutorial. Could you please check that it is correct?
http://www.opentk.com/doc/chapter/2/glcontrol