Questions tagged [opentk]

The Open Toolkit is an advanced, low-level C# library that wraps OpenGL, OpenCL and OpenAL. It is suitable for games, scientific applications and any other project that requires 3d graphics, audio or compute functionality.

The opentk toolkit wraps OpenGL, OpenCL, OpenAL to C#. This is done using types aiming to make development less error-prone.

The project ships with additional code for instance to render OpenGL graphics on a System.Windows.Forms.Form dialog or control together with loaders for various format.

The project is licensed under the MIT/X11 license.

References

Tutorials and examples:

972 questions
3
votes
1 answer

Handling Device change in OpenAL

I'm trying to write an application using OpenTK.OpenAL to wrap openal, and I'm concerned about how I should handle a hypothetical situation where I unplug my default audio output device (such as headphones). When I try to open my default device, it…
cloud
  • 43
  • 2
  • 6
3
votes
1 answer

Can't get stencil buffers to work in OpenTK, simple 2D quads

I've been trying with no success to get stencil testing to work in my OpenTK 2D game - I want to only draw parts of a texture below values of say 1 in a stencil buffer. Have spent ages reading up on stencils and how they work but can't find a single…
Mr Pie
  • 327
  • 2
  • 11
3
votes
2 answers

How To Draw A Frustum in OpenGL

I created a frustum class using C# and OpenTK, and it works perfectly. However, I want to be able to draw the bounds of the frustum for debugging purposes. I have no idea how to get the vertex data from the Matrix data for drawing though. I was just…
Krythic
  • 4,184
  • 5
  • 26
  • 67
3
votes
1 answer

OpenGL Texture Mapping by Pixel Region

Suppose you have a simple Tileset for a game, like this: Now, when dealing with a simple GUI framework such as .NET, it would be rather easy to load that image, select portions of it, and then draw it tile-by-tile. However, when using OpenGL, this…
Krythic
  • 4,184
  • 5
  • 26
  • 67
3
votes
1 answer

adding GLcontrol to visual studio toolbox

maybe the question is simple but I'm using OpenTK with WinForms , the problem is I can't find GLcontrol in the toolbox , so I added it manually in Form1.Designer.cs , this is the code #region Windows Form Designer generated code ///…
niceman
  • 2,653
  • 29
  • 57
3
votes
1 answer

Draw text using OpenTK

I'm going crazy trying to draw some text over an OpenGL window using OpenTK! I followed some of the tutorials around but I can't make it work, when I enable the texture where the text is drawn, then I just have a white window and the QUAD I'm…
Pedro Ferreira
  • 852
  • 9
  • 23
3
votes
2 answers

how to capture the image drawn using opentk

My goal is to draw things with opentk in c# on a GL_Control (a gui control) AND also save it to a Bitmap object everytime the paint event is called. I have this code: private void glControl1_Paint(object sender, PaintEventArgs e) { // do lots of…
max
  • 9,708
  • 15
  • 89
  • 144
3
votes
1 answer

WPF MVVM WinformsHost with OpenGL-Control

I'm developing a WPF-application with MVVM. In this application I need to have an OpenGL-Control (I'm using OpenTK). The currently only useful way to get OpenGL in WPF is using a WindowsFormsHost. Until here, there's no problem. To add content to my…
freakinpenguin
  • 831
  • 14
  • 24
3
votes
1 answer

OpenGL pass color to fragment shader

I'm currently try to build a test scene with shaders. This is my code. vertexArray = GL.GenVertexArray(); GL.BindVertexArray(vertexArray); float[] Vertices = new float[] { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f,…
fedab
  • 978
  • 11
  • 38
3
votes
4 answers

How to make objects transparent in OpenTK

I'm using OpenTK and C#, I have defined a plane in 3D space as follows: GL.Begin(BeginMode.Quads); GL.Color3(Color.Magenta); GL.Vertex3(-100.0f, -25.0f, -150.0f); GL.Vertex3(-100.0f, -25.0f, 150.0f); GL.Vertex3( 200.0f, -25.0f, …
harishli2020
  • 305
  • 6
  • 19
3
votes
1 answer

How to achieve better anti-aliasing in GlControl in OpenTK?

OpenTK offers two approaches how to use OpenGL: GlControl which is standard WinForms control, and Native window with OpenGL context. I am using the GlControl and the FSAA seems to be low quality. I am developing an application with many controls…
NightElfik
  • 4,328
  • 5
  • 27
  • 34
3
votes
1 answer

How to enable antialiasing (4X MSAA) for AndroidGameView?

I have a simple OpenGL application which I'm trying to enable antialiasing (4x MSAA) for. I can't seem to figure out how to do this using AndroidGameView. So far I've been forcing 4x MSAA through the Developer Settings menu as a short term solution…
safwanc
  • 3,351
  • 2
  • 15
  • 20
3
votes
1 answer

OpenGL UI library for C# with OpenTK

I'm writing a game engine in C# using OpenTK, and I'm trying to add support for UI to the engine. Writing this from scratch seems like a big headache and if someone else made a library to do it instead, that would be a lot faster.
Layl Conway
  • 385
  • 9
  • 17
3
votes
1 answer

Easiest way to play audio in an openTK application, using any method

My goal here is to be able to play an MP3 in an OpenTK/OpenGL application (.NET but NOT windows forms), being able to stop/play/pause it, access/set the position of the audio file, and have it play to within a few milliseconds of when I tell it…
stingray-11
  • 448
  • 2
  • 7
  • 25
3
votes
0 answers

opentk to opengl System.NullReferenceException

I followed the steps outlined here in the tutorial http://www.opentk.com/doc/chapter/0, and then tried the more expansive setup. However, I can not run any code with (I think) OpenGL. The example browser program loads fine and I can run the Open AL…