GhostTyper's picture

multiple glcontrols in one application


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?


Comment viewing options

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

It is possible, and has been discussion in the forums:

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.

GhostTyper's picture

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!


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.

objarni's picture


I've added the info to the GLControl tutorial. Could you please check that it is correct?