Questions tagged [sharpgl]

SharpGL is a C# library that allows you to use OpenGL in your .NET Framework based application with ease!

SharpGL is a C# library that allows you to use OpenGL in your .NET Framework based application with ease!

SharpGL comes packaged with many sample applications to demonstrate key features or for you to use as starting points for your own development.

Some features:

  • Full support for all OpenGL functions up to OpenGL 4.2;
  • Full support for all commonly used OpenGL extensions;
  • Support for WinForms applications;
  • Support for WPF applications (without resorting to WinForms hosts);
  • A powerful scene graph including polygons, shaders, NURBs and more;
  • Many sample applications as starting points for your own projects;
  • Visual Studio Extension with SharpGL project templates for WPF and WinForms.

Source:

https://github.com/dwmkerr/sharpgl

http://sharpgl.codeplex.com/

89 questions
5
votes
2 answers

SharpGL- Detecting Mouse Clicks on OpenGL Elements Using Selection and Picking

I am implementing a 2D graph in WPF using the SharpGL library. I have managed to draw some primitive objects on the screen and I need to detect mouse clicks on these objects. I've taken a look at an OpenGL tutorial on how to perform selection and…
mobearette
  • 377
  • 10
  • 26
4
votes
0 answers

Get screen shot on macOS from NetCore 3.1?

I need to get a screenshot on macOS from netcore 3.1 app. Unfortunately current implementation of System.Drawing.Graphics.CopyFromScreen thows PlatformNotSupportedException. But what other simplest way (maybe over OpenGL or GTK) get a screenshot?
Sergey Shulik
  • 950
  • 1
  • 9
  • 24
4
votes
0 answers

C# Revit Extension using WPF & SharpGL

I'm trying to create a Revit Extension using SharpGL in WPF window and just can't get the FPS over 10. WPF & SharpGL work smooth together without Revit. This is the simple code public class Class1 : IExternalCommand { public Result Execute( …
Luka
  • 51
  • 3
2
votes
1 answer

Unable to draw spheres with arbitrary color

I am using SharpGL. I am trying to draw three overlapped spheres with three different colors like the following - However, I am getting output like the following - In other words, the gl.Color() is having no effect on the drawn object. How can I…
user366312
  • 16,949
  • 65
  • 235
  • 452
2
votes
1 answer

SharpGL.SceneGraph and SharpGL.Serialization libraries not installed with SharpGL

I'm attempting to run a WPF application using the SharpGL library. According to the docs described on the GitHub page it should be as easy as PM> Install-Package SharpGL.WPF, but when attempting to create an OpenGLControl in xaml like this
James B
  • 8,975
  • 13
  • 45
  • 83
2
votes
2 answers

SharpGL - draw sphere with mesh and attach color to each one

I'm creating a 3d visualization in SharpGL (extension for Visual Studio 2013 where we can use OpenGL library). I want to visualize tetrahedron. It needs to be created from many points - user at the start of application defines the sum of vectors. I…
blackRose
  • 180
  • 1
  • 9
2
votes
1 answer

Diagnosis of error 1008 when calling wglsharelists for two OpenGL contexts

I'm having troubles diagnosing the cause of error 1008 when calling wglsharelists to share the space of two OpenGL contexts (created using sharpgl). The call returns false and the last error code retrieved is 1008. I've made the two OpenGL…
Ross Batten
  • 114
  • 8
2
votes
0 answers

C# sharpGL use texture on SharpGL.SceneGraph.Primitives.Polygon

I'm using SharpGL library for Visual C#. I want to add texture to SharpGL.SceneGraph.Primitives.Polygon. SharpGL.OpenGL gl = this.openGLControl1.OpenGL; textureImage = new…
Dimastr
  • 21
  • 1
2
votes
0 answers

SharpGL- DrawArrays gives AccessViolationException

I am creating a Modern OpenGL hello world app in WPF using SharpGL samples as a guide. I seem to be getting an AccessViolation Exception when calling DrawArrays in the Draw method. Having checked the internet - they all suggest it could be the…
user2822838
  • 337
  • 1
  • 3
  • 13
2
votes
3 answers

Why is an Exception occurring in SharpGL.dll?

I am attempting to plot something simple like a triangle using VBO's. The example code is provided on github here: https://github.com/dwmkerr/sharpgl/blob/master/source/SharpGL/Samples/WinForms/ModernOpenGLSample/Scene.cs The following 'using'…
Timothy Swan
  • 623
  • 3
  • 9
  • 21
2
votes
1 answer

SharpGL and Geometry Shader

Have anyone used geometry shaders in SharpGL? I cannot figure out how to accomplish it in my code. As I see method Create which is provided with ShaderProgram from SharpGL.Shaders take only Vertex Shader and Fragment Shader as parameters. public…
frankie
  • 728
  • 1
  • 10
  • 28
2
votes
3 answers

OpenGL: More vertices, slower performance

I am working on a part of a program where given a collection of xyz-coordinates, a 3D model is made. I have all of the functionality needed for this picture done (i.e. panning, rotating, scaling) however the more xyz-coordinates given, the slower my…
TheBlindSpring
  • 631
  • 5
  • 22
1
vote
1 answer

Unable to draw a Cube

I am using SharpGL. I am trying to adapt the source code available here. They are drawing a pyramid and a cube. I am trying to draw only a cube, like the following - I am getting the following output - Please, remember that, this output is only…
user366312
  • 16,949
  • 65
  • 235
  • 452
1
vote
1 answer

The hidden surface removal is not working as expected

I am using SharpGL library. The following source code draws several hundred solid spheres at various locations - // Initialization routine. void setup() { gl.ClearColor(0.0f, 0.0f, 0.0f, 0.0f); …
user366312
  • 16,949
  • 65
  • 235
  • 452
1
vote
0 answers

SharpGL / OpenGL WPF

I started studying SharpGL on WPF, and I wanted to learn how to output a picture, I found a tutorial where it was shown how to output a picture, but after rewriting the code to myself, the picture is not output, but output a red image, what could be…
Vera
  • 11
  • 1
1
2 3 4 5 6