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
0
votes
1 answer

Why are all the cubes drawn in SharpGL white?

I am writing a program in WPF, using SharpGL, to draw some cubes. In my software, a large number of cubes need to be drawn. Initially, I used the immediate mode rendering method, which makes the app too slow. After that I use the VAO method, the app…
Reza 110
  • 31
  • 4
0
votes
1 answer

c# winform sharpgl, get modelview matrix and openglControl doesen't drawing

I have an interresting thing. I want to get the rendered objects window coordinates. When i use this in OpenGLDraw event: var modelview = new double[16]; gl.GetDouble(OpenGL.GL_MODELVIEW_MATRIX, modelview); Drawing…
Thomas
  • 33
  • 1
  • 3
0
votes
0 answers

Delay in drawing cursor position with SharpGL

I'm trying to draw the cursor position, with a square, when mouse moving. I'm using SharpGL and the OpenGLControl, but there is a delay between cursor arrow and the drawn square. On MouseMove event I store a square centered in the mouse position…
Tostone
  • 95
  • 1
  • 9
0
votes
0 answers

OpenGL Not Displaying Texture on Quad

I'm trying to have a quad in OpenGL have a texture, but my attempt has come up futile. My quad only shows up as white. Here's the code: using System; using System.IO; using System.Drawing; using System.Collections.Generic; using System.Linq; using…
IIRawCodeII
  • 375
  • 1
  • 3
  • 9
0
votes
1 answer

SharpGL + WPF: Draw are events never called

I'm trying to build a SharpGL app with WPF, but have trouble integrating a view model. I bind the DataContext of an OpenGLControl to an OpenGLControl property in my ViewModel and create events for the drawing functions in the view model, but they…
0
votes
1 answer

How do I attach a depth buffer to an FBO context using sharpgl

So after many headaches trying to get depth testing working with an FBO render context in WPF with SharpGL I understand it's not as simple as setting gl.Enable(GL_DEPTH_TEST) like it is with old-style OpenGL and that I have to attach a depth buffer…
Ross Batten
  • 114
  • 8
0
votes
0 answers

Can anyone explain this small offset from ray casting by mouse click?

I'm using SharpGL in a WPF window and have navigation and plotting of a survey point cloud with custom shaders for distance-based point size reduction. All working well but I've recently attempted to add the ability to select a point nearest to the…
Ross Batten
  • 114
  • 8
0
votes
2 answers

SharpGL.WPF gl.Color not working

I am using SharpGL.WPF for displaying graphs of several mathematical equations. However, the gl.Color() is not working for me. Here is my draw method which I call in the OpenGLDraw event: private void DrawLinearFunction(OpenGL gl) { …
Dale Julian
  • 1,560
  • 18
  • 35
0
votes
1 answer

glLookAt moves camera position when lookAt is moved - role of projection matrix?

Short version: I'm using a glLookAt view matrix with a perspective projection matrix, and I'm wondering why a change in the camLookAt vector (the point where I'm looking at) leads to a change in the camera's position. Long version: I'm using the…
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
0
votes
1 answer

Setting values to TexImage3D function in SharpGL C#

C++ Code using OpenGL: vector LUT; //creating a vector3 array glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, 16, 16, 16, 0, GL_RGB,GL_FLOAT, &LUT[0]); The above C++ code is working fine. &LUT[0] is accepted as it is of type const GLvoid * data C#…
cona mx
  • 55
  • 6
0
votes
1 answer

SharpGL FBO / VBO drawing simple triangle not working

Im trying to use FBO/VBO in OpenGL with SharpGL. Using for this WPF app. The problem is, example triangle dont render. Adding component is with this code: glControl = new OpenGLControl(); glControl.RenderContextType =…
Rhonin
  • 474
  • 4
  • 20
0
votes
1 answer

SharpGL and RenderBuffers

I'm attempting to port a pathtracer to GLSL, and to do this I need to modify a shader sample program to use a texture as the framebuffer instead of the backbuffer. This is the vertex fragment #version 130 out vec2 texCoord; //…
Dom
  • 3
  • 1
0
votes
2 answers

Can't pass color from vertex shader to fragment shader

I'm new to OpenGL and study it using SharpGL which is simple C# binding to OpenGL functions.I'm trying to use the simplest vertex and fragment shaders. When fragment shader generates output by itself, everything is fine, but when it tries to use…
0
votes
2 answers

SharpGL 2D Texturing issue

I am trying to texture triangle with runtime generated texture using SharpGL wrapper. I can't figure out why triangle remains not textured. gl.Error() put in draw loop returns 0 which means GL_NO_ERROR. private void openGLControl_OpenGLDraw(object…
0
votes
1 answer

Bad Performance of sharpGL inside WPF

I have followed a SharpGL tutorial that can display a rotating block. Initially this only had default colors drawn on it with gl.Color(r, g, b). After this succeeded I tried to texture the cube with an uv map. When I run the application fullscreen…
bas
  • 1,678
  • 12
  • 23