jaggieboy's picture

What is the difference between GLControl and GameWindow?

Hello all, I'm gonna go straight to the problem I'm facing right now. So, after coding a while ago I've become a bit confused whether to use GLControl or GameWindow on my application using OpenTK library.

Anyone can tell me the differences between the two? so I'll get the answer to "which one should I use?"
Or, maybe there are links to some posts in this forum or at the other sections of the site? because after a while searching on this site, I haven't found any page explaining the differences between the two components.

Ok, that will be my first question here, and thanks in advance for the upcoming answers from you guys!


Comments

Comment viewing options

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

To put it simply, GameWindow gives you more control and better rendering/update loops, while GLControl allows you to use standard Windows Forms controls in your window (if I understand correctly; haven't actually used OpenTK yet, myself).

the Fiddler's picture

GLControl works in conjunction with Windows.Forms, which means you can use the Visual Studio designer to set your window properties and hook events. This is useful if you wish to design a GUI (for example a level editor or a 3d modeler). The main downside is that WinForms aren't meant for event-based GUIs, not for games running at 60+fps, and performance does suffer somewhat as a result. The other downside is that WinForms are very win32-centric and don't run very well on other platforms.

GameWindow is designed specifically for games running at 60+fps. It has specific backends for each platform (win32, xlib, carbon) and doesn't leak memory. The downside is that it is less flexible than GLControl and doesn't offer any niceties for designing GUIs (you can still create a GUI, but you'll have to do it from scratch).

Both offer pretty similar APIs, so just pick the one that feels like a better fit right now.

jaggieboy's picture

Thank you for the response!
I see, so GameWindow and GLControl are somewhat the same,
knowing that both offer similar API, I think it wouldn't be a problem if I switch from one to another right?

Once again, thanks in advance for the upcoming responses.

the Fiddler's picture

Switching from one to the other is certainly possible. There are some differences, esp. in mouse/keyboard handling, but nothing impossible to change later on.