
[solved]Windows Form Applications and OpenGL Control
Posted Monday, 6 December, 2010 - 18:38 by Ctank02 inHello,
I am relatively new to OpenTK (been tinkering for about 2 hours now). I stumbled across this: http://www.opentk.com/doc/chapter/2/glcontrol?page=2 and decided to try it out.
The demo is not working. In fact, it appears that the windows form is not receiving OpenGL events/commands/[insert proper name].
Here is the setup I have:
Visual Studios 2010 (Professional)
Added References:
OpenTK
OpenTK.GL.Control
I have added the GLControl to my form (found in the toolbox).
I attached a png of my output.
Thanks for any help that can be provided.
P.S. if I missed this in my search, apologies.


Comments
Re: Windows Form Applications and OpenGL Control
As a sanity check, try running OpenTK Example Browser -> OpenTK samples -> GLControl simple. Does it work? (It should display a red window and three buttons that change its color).
Re: Windows Form Applications and OpenGL Control
Actually...It does not appear to work. Now, I think I may foresee your next question. I have run OpenGL with Python/Pyglet for quite sometime now, so I believe I have the required OpenGL drivers.
Re: Windows Form Applications and OpenGL Control
Right, thanks. In this case we'll need some debugging information.
Open OpenTK.sln with Visual Studio, make sure the configuration is set to Debug and hit compile. Now run the OpenTK.Examples project -> GLControl Simple and post the text from the "Application Output" panel in Visual Studio (View -> Output or Ctrl-W, O).
This should give a hint about the issue.
Re: Windows Form Applications and OpenGL Control
Hmm, the results were less than exciting. From what I can tell, the default color of the windows in your examples is 'skyblue'. That is all I see, the default color of the output/source code tabs. This is true for every example (mind you, I randomly clicked multiple ones from each section, not all of them).
Corrupt download? Does OpenTK have a special driver I missed?
Re: Windows Form Applications and OpenGL Control
Hmm, the results were less than exciting. From what I can tell, the default color of the windows in your examples is 'skyblue'. That is all I see, the default color of the output/source code tabs. This is true for every example (mind you, I randomly clicked multiple ones from each section, not all of them).
Corrupt download? Does OpenTK have a special driver I missed?
Most examples use a blue color for the background, but "GLControl Simple" should look similar to this:
What video card are you using? Do the examples actually work?
Re: Windows Form Applications and OpenGL Control
GeForce Go 7900 GS (Laptop). No, none of the examples are working. That was the point I was trying to make earlier. AL, Cl, GL, doesn't matter, I couldn't get them to show output.
EDIT: Reinstall didn't fix the problems....
Re: Windows Form Applications and OpenGL Control
Alright, in that case the only way to diagnose the issue is to compile a debug version of OpenTK, run an example (Simple GameWindow, preferably) and post the results from the "Application Output" window here.
I'm also using Nvidia cards (6800 Go and 9500GT) and OpenTK works here, so this might be an unfortunate incompatibility with your specific drivers/OS/hardware you. Using the debug information, I might be able to find the cause and fix the problem.
Re: Windows Form Applications and OpenGL Control
Alright, in that case the only way to diagnose the issue is to compile a debug version of OpenTK, run an example (Simple GameWindow, preferably) and post the results from the "Application Output" window here.
I'm also using Nvidia cards (6800 Go and 9500GT) and OpenTK works here, so this might be an unfortunate incompatibility with your specific drivers/OS/hardware you. Using the debug information, I might be able to find the cause and fix the problem.
Output from Debug Console:
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Users\ctank02\Documents\OpenTK\1.0\Binaries\OpenTK\Debug\Examples.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x1280) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x127c) has exited with code 0 (0x0).
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Users\ctank02\Documents\OpenTK\1.0\Binaries\OpenTK\Debug\Examples.exe', Symbols loaded.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Users\ctank02\Documents\OpenTK\1.0\Binaries\OpenTK\Debug\OpenTK.dll', Symbols loaded.
'Examples.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Users\ctank02\Documents\OpenTK\1.0\Binaries\OpenTK\Debug\OpenTK.GLControl.dll', Symbols loaded.
I wasn't sure if you wanted me to try and extract that demo out of the example project and run it by its self, so I did not (looked like it might have had some dependencies with other files - the utilities dependency was the one I got stuck on).
Re: Windows Form Applications and OpenGL Control
No need to extract the sample, running it directly is fine.
Does the output stop at that point? That's strange, here is how it looks on my system (the interesting part comes right after your post ends):
Re: Windows Form Applications and OpenGL Control
Does the framework have a debug option? AKA a flag somewhere in the files that needs to be set for me to see that?
Here is what I did:
I ran 'Build' on the entire OpenTK.sln
I then right click the OpenTKExamples and choose debug (Start a new instance).
I then navigate to the GameWindow simple and nothing shows up. All of the output I pasted actually shows up before I navigate there.