This project is read-only.

Can't add SharpGL controls

Apr 29, 2012 at 7:06 PM
Edited Apr 29, 2012 at 9:06 PM

I'm somewhat new to both OpenGL and Visual Studio, so I apologize if I'm missing something basic, but when I open up the sample solution in VS (and ignore the errors about "Solution folders not being supported in this version of the application" and "source control providers not being found"), I see they use controls like VertexControl, OpenGLControl, and SceneControl, which have their own special category in the toolbox.  However, when I make my own, new SharpGL windows form application, that category is gone and I can't add any of those controls (though the default OpenGLControl is there in the designer and not in the toolbox).  Further, I can't seem to add them to the toolbox manually by creating a new tab and right click->choose items, selecting SharpGL.dll or SharpGLSceneGraph.dll).

However, the application I'm trying to design would involve raising/lowering vertices on a flat landscape made of quads - and from what I've read so far, scripting picking from scratch seems very complicated.  A few of the SharpGL controls (SceneControl, maybe VertexControl?) seem from the samples like they could be a huge help, but I can't add them.  I followed the instructions when installing SharpGL (they are rather simple, after all) - but perhaps there's something else I have to do, beyond just installing SharpGL, to make those controls available?  Do I have to add some special reference? 

I'm using Visual Studio 2010 and have installed the SharpGL extension from the downloads page.

Apr 30, 2012 at 2:21 AM

I believe you're on the right track, but the DLL's with the controls you're looking for are SharpGL.Winforms.dll (if a Windows Forms app) or SharpGL.WPF.dll (for WPF apps).  If you go to the Toolbar and right-click and choose "Choose Items," then select those DLL's, you should find the controls you're looking for.   You may also have to reference in the SharpGL.dll (and the SharpGL.SceneGraph.dll) files into your project, as well - I can't recall off the top of my head.

Apr 30, 2012 at 10:43 AM

Please also go to your project settings and make sure that you're targetting the .NET Framework 4.0 - not the .NET Framework 4.0 Client Profile!

May 1, 2012 at 9:34 PM

Thanks!  I made sure I was targeting the 4.0 framework and referenced the WinForms.dll - now everything's working properly.

Thanks again! 

May 2, 2012 at 9:35 AM

My pleasure, glad it's all working!

Sep 27, 2012 at 12:00 PM

I can't use the  OpenGLControl , it throws an exception right in the designer and writes out "Object reference not set to an instance of an object. Stack trace: at SharpGL.OpenGLControl.OnPaint(PaintEventArgs e)". I tried all this with the SharpGL 2.0 Beta 1.

what can I do?

Dec 13, 2014 at 11:19 PM
Hi,

i have similar problem. I am write win. forms app. my code.

I added sharpGL.dll, sharpGLSceneGraph.dll,sharpGL.serialization,SharpGLWinForm.dll and sharpGLWPF.dll with add to reference. Additionally added openGLcontrol (component) with choose item at toolbox. No. problem.

I looked at all example. Samples were run smoothly. I try want to do myself the example( examp: simpledrawing" ).
However,
error: The type or namespace 'Render EventArgs' could not be found (are you missing a using directive or an assembly reference?)
and not be openGL_control........

Please can you help?
Feb 11, 2015 at 3:12 PM
Where to find those DLL files?
Feb 13, 2015 at 7:04 AM
Did you try the Visual Studio extensions for SharpGL? They provides project templates for WinForms and WPF applications using the SharpGL controls. Go to TOOLS\Extensions and Updates... and Search for SharpGL.

Or add the SharpGL NuGet Packages for WinForms or WPF to your solution.



Von meinem Windows Phone gesendet

Von: [email removed]
Gesendet: ‎11.‎02.‎2015 16:12
An: [email removed]
Betreff: Re: Can't add SharpGL controls [sharpgl:353958]

From: techdm81

Where to find those DLL files?
Feb 13, 2015 at 7:06 AM
I did that and downloaded it from GITHUB too.
After that I build it and then go DLLs. Now it is working.
However when using extension downloading I do not get control in toolbox but using DLLs I got it working.
Feb 13, 2015 at 7:58 AM
Good point. Extensions do not add the controls to the toolbox. We should add this in the next version.

Cool that it works for you now.


Von meinem Windows Phone gesendet

Von: [email removed]
Gesendet: ‎13.‎02.‎2015 08:06
An: [email removed]
Betreff: Re: Can't add SharpGL controls [sharpgl:353958]

From: techdm81

I did that and downloaded it from GITHUB too.
After that I build it and then go DLLs. Now it is working.
However when using extension downloading I do not get control in toolbox but using DLLs I got it working.
Feb 14, 2015 at 11:50 AM
Should give that Russian video on SharpGL that helped me to do this. Full credit to the instructor.
Link for the video - https://www.youtube.com/watch?v=Ih7gO5TU6dU