aussa's picture

New in OpenTK

Hi, I downloaded OpenTK. Built it in Monodevelop. Everything fine until then. Now I'm trying to add it to the Monodevelop Toolbox, according to this: http://www.opentk.com/doc/chapter/2/glcontrol , I have to look for OpenTK.dll from the add button on the Toolbox. This is what it get: "The file OpenTK.dll does not contain any component.". Help please. :D

Another thing, what does it mean "Additionally, you should add OpenTK.dll.config to your project and instruct your IDE to copy this file to the output directory." ---> http://www.opentk.com/doc/install

Thank you.


Comments

Comment viewing options

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

To use OpenTK, you need to add it to your project references. Locate your "solution" pane (this is the one that contains your .cs files), right click on "References" and select "Edit references". A new window will open: locate OpenTK.dll and click "Add".

OpenTK.dll.config is a small configuration file that is necessary on Linux/Mac OS X. You can also add it to your project through the solution pane: right click on your project name, select "Add existing item", locate OpenTK.dll.config and click "Add". Once you do this, OpenTK.dll.config will appear in the solution pane: right click on it and select "Copy to Output" (this option is hidden in some sub-menu, try under "Build Actions" or the one below that).

You will be going through these motions a lot while programming (i.e. they are not specific to OpenTK). You should consult the documentation of MonoDevelop for more specific information but feel free to ask here if you encounter any problems.

aussa's picture

Ok, thanks for your help, now, how do I do this:

"Adding the GLControl to your Windows.Form
(I am assuming you are using Visual Studio 2005 Express Edition. Your mileage may vary if using VS2008 or Monodevelop -- I don't know the details for them -- but the follow sections should be the same no matter how you add the GLControl)
To begin with, create a Form on which you will place your GLControl. Right click in some empty space of the Toolbox, pick "Choose Items..." and browse for OpenTK.dll. Make sure you can find the "GLControl" listed in the ".NET Framework Components", as in the image below."

http://www.opentk.com/doc/chapter/2/glcontrol

I look for OpenTK.dll from the add button on the Toolbox. This is the error I get: "The file OpenTK.dll does not contain any component.". What am I doing wrong?

the Fiddler's picture

The instructions were a little outdated (fixed now). GLControl is located in OpenTK.GLControl.dll now.

aussa's picture

Is the one that is in the Binaries/OpenTK/Release folder? if it is, it is not working, same error "The file OpenTK.GLControl.dll does not contain any component." :S, any solution?

the Fiddler's picture

The message is correct: GLControl is a WinForms component and MonoDevelop does not have a WinForms designer. Three solutions:

  1. Use the GTK# graphical designer found in MonoDevelop. In that case, you will need GLWidget.
  2. Use WinForms/GLControl without a graphical designer.
  3. Use OpenTK.GameWindow.
  4. If you are trying to create a GUI, go with #1 or #2. If you are trying to create a game-like application, go with #3.

aussa's picture

Ok, I think I'll go with #1. One last question, I'm not sure what do you mean by game-like application? Could you explain that to me? :D

the Fiddler's picture

I meant real-time games, simulations, virtual reality and anything else that requires smooth 60fps rendering.

GUI applications are quite different: they rely on event-based updates and draw only when something changes on screen (instead of 60 times a second). They have completely different performance characteristics and requirements, e.g. in regards to garbage collection.

GameWindow is optimized for the former use-cases. WinForms and GTK# are a better fit for the latter.

protandeous's picture

I am using VS2010 and have used "Choose Items..." and browsed to "OpenTK.GLControl.dll" and I see the "GLControl" within the ".NET Framework Components" tab. However I do not see a tool back in the main toolbox in order to add it to my form. I have attempted to "new" one up and Add it as a child control, and I have tried to create a "UserControl" form with the x:Class and xmlns tags with "Code-Behind" in CS, to no avail. What am I missing?

protandeous's picture

Success! See here: http://www.opentk.com/node/3344