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
1
vote
1 answer

SharpGL WPF Not drawing with gl.DrawArrays() and gl.VertexPointer()

I'm trying to use SharpGL to render in a WPF application using gl.VertexPointer() and gl.DrawArrays(). But I cannot get it to render a square. The background clears to green and I can see the FPS drawing at the bottom left of the WPF panel. When…
szMuzzyA
  • 136
  • 13
1
vote
1 answer

How to remove this redbox in scene?

How to remove this redbox in the scene? I use SharpGL. If it is default box and I can't remove it? Need your help, guys. Code of program is here. It should rotate and scale .obj file. All work's correctly but I need to remove this redbox. Maybe…
1
vote
0 answers

Change width, color, line type in SharpGL

Need help because I'm new to OpenGL. So, my task is to create a control that will draw in real time the process of cutting a workpiece on a CNC machine. I tried to do it classically through glBegin, glEnd and everything works fine, but due to the…
1
vote
1 answer

Simple code for transformation in OpenGL/SharpGL (without matrix theory lessons)

I have an OpenGL .NET WPF (SharpGL) app which draws small squares in immediate mode, they are really 3D: float z = -200f; float farz = 400f; ... // init gl.ShadeModel(OpenGL.GL_SMOOTH); gl.ClearColor(0.0f, 0.0f, 0.0f,…
Boppity Bop
  • 9,613
  • 13
  • 72
  • 151
1
vote
1 answer

OPENGL (GLFW), glDrawElements gives out "Acces.ViolationException"

(I'm a pretty new Coder (at least in Graphics programming), so don't be too harsh with me :( ) Today I tried to render a simple triangle using the C# implementation of OpenGL (GLFW), I followed the web tutorial from "LearnOpenGL.com" specifically…
LeKerk
  • 13
  • 2
1
vote
0 answers

SharpGL WPF draw from code behind not using OpenGLDraw

I'm trying to draw on a OpenGLControl from the code behind (or preferably using the MVVM pattern) without using the OpenGLDraw eventhandler. The reason for this is that I'm using it for augmented reality and the camera is using an external trigger,…
MrEighteen
  • 434
  • 4
  • 16
1
vote
2 answers

How to scale a figure?

Render triangle: private void OpenGLControl_OpenGLDraw(object sender, SharpGL.SceneGraph.OpenGLEventArgs args) { OpenGL gL = GLControl.OpenGL; gL.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); gL.LoadIdentity(); …
xomem
  • 147
  • 7
1
vote
0 answers

Lighting not working in SharpGL

I've got a problem with lighting in SharpGL - I tried everything, and the result is still gray object. What am I doing wrong? How can I get it to work? I want to get some shading effect, just anything. Here's my code: private void Draw(OpenGL…
Raven
  • 11
  • 1
1
vote
1 answer

Why can't I set Texture Wrap parameters using OpenGL in C#? (SharpGL dll)

I've been building a method to colour (I'm Australian) vertices of a digital terrain model in a WPF app using SharpGL. The problem I'm facing is that I can't seem to change the GL_TEXTURE_WRAP_T and S parameters to anything other than GL_REPEAT…
Ross Batten
  • 114
  • 8
1
vote
1 answer

SharpGL controls don't appear in toolbox

I have created new WinForm project and have installed SharpGL package for WinForms: Install-Package SharpGL.WinForms, but appropriate controls did not appear in toolbox. How to make them appear? note: This samples…
Yaros
  • 75
  • 8
1
vote
2 answers

SharpGL Screen / Cursor Coordinate to Model View

Using SharpGL, is it possible to transform the screen cursor position back to a model view location (ie. create a ray-cast function)? The example I have been working with is similar to the following: private void OpenGLControl_OpenGLDraw(object…
James
  • 97
  • 1
  • 9
1
vote
1 answer

SharpGL: Can't draw all lines from List

I have: float[,] nodesN = null; //indexes: //number of node; //value index 0->x, 1->y, 2->temperature int[,] elements = null; //indexes: //indexof element (triangle) …
Miko Kronn
  • 2,434
  • 10
  • 33
  • 44
1
vote
1 answer

SharpGL not rendering on Button Click

I was testing the SharpGL sample on winform, where it is rendering triangle on openGLDraw event. But when I am trying to render it with button click its not working. Is it supposed to not render outside of openGLDraw event ? Here are the…
Barun
  • 1,885
  • 3
  • 27
  • 47
1
vote
1 answer

How to make Render Trigger Manual in SharpGL/WPF

I've installed SharpGL control for WPF. The control is always in Render Loop by which I mean it renders in certain intervals. What I want is a one time draw. Because I'm not making a game and I don't need the scene to be rendered constantly. What…
Vahid
  • 5,144
  • 13
  • 70
  • 146
1
vote
2 answers

C#: WinForms/WPF Render Loop

I want to make a render loop to render on a WPF Window or a WinForm. Therefore I want to use SharpGL (https://sharpgl.codeplex.com/). To make my loop I made a thread: public void Run() { IsRunning = true; this.Initialize(); …