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
3 answers

Opengl - "fullscreen" texture rendering performance issue

I am writing a 2D game in openGL and I ran into some performance problems while rendering a couple of textures covering the whole window. What I do is actually create a texture with the size of the screen, render my scene onto that texture using FBO…
Milcho
  • 329
  • 1
  • 3
  • 9
2
votes
2 answers

How to render using OpenTK GLWidget in Monodevelop?

I'm trying to use this GLWidget thing to develop using OpenTK and GTK#, it seems like a good thing, but sadly there's next to no documentation for it. I'm trying to understand how to render anything in that Widget. So far, I created a monodevelop…
Samssonart
  • 3,443
  • 3
  • 31
  • 41
2
votes
1 answer

Is GLWidget for OpenTK and GTK# reliable?

I'm creating an application that need a nice GUI and some openGL rendering (I need to draw 3D objects based on mouse click coordinates). Since I need this to be multiplataform I'm using mono and OpenTK, for the GUI I was thinking GTK#, and I…
Samssonart
  • 3,443
  • 3
  • 31
  • 41
2
votes
1 answer

OpenTK stencil buffer

I'm new to opengl and I'm struggling to get the stencilbuffer to work for a simple case; I have two textures, one being a bitmap and one being a "mask", with which I'm trying to hide some parts from the bitmap. I can't seem to get this to work, when…
Martijnh
  • 333
  • 2
  • 10
2
votes
3 answers

How to lock cursor to game window?

I'm trying to implement camera movement for an FPS game. I think I've almost got it, but there's just a few more kinks to work out. I've got my mouse movement set up like this: protected override void OnLoad(EventArgs e) { Mouse.Move +=…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
2
votes
1 answer

Load png with OpenTK and MonoDroid

I'm looking for an example of loading a png-file on MonoDroid using OpenTK. Anyone? Thanks!
Andreas
  • 5,501
  • 2
  • 20
  • 23
2
votes
0 answers

How to test OpenTK based code with Nunit?

I want to Unit Test (or, if you please Function Test) OpenTK rendering results with NUnit. I normally use a GameView to initalize and run the application. Unfortunately the GameView seems to lack a public method to render just a single frame which…
Rodja
  • 7,998
  • 8
  • 48
  • 55
2
votes
3 answers

Only fire events at a specific time in C#

I am writing a video game in C#, and I would like to handle certain events (e.g. keyboard/mouse events) only at a specific point in my game loop. For example, is there a way to write something like the following: void gameLoop() { // do updates …
fyhuang
  • 2,147
  • 5
  • 21
  • 24
2
votes
1 answer

MonoTouch: Enable Multisampling in OpenGL ES 2.0

Is there any way to activate multisampling with MonoTouch and OpenGL ES 2.0? I can't find the apple extension in the framework, so i think it's not implemented?
Felix K.
  • 6,201
  • 2
  • 38
  • 71
2
votes
2 answers

OpenTK: Using different colors with a VBO

Situation: I am drawing with OpenGL in C# with the library OpenTK. . Problem: I cannot choose which one of my buffers/sets of vertices to draw. . Setup-Function: var vertices = new Vertex[..]; Create the vertices foreach( .. ) { Byte4 color = new…
jontelang
  • 589
  • 4
  • 17
2
votes
1 answer

Getting the Mouse window coordinates in OpenTK (C#~.NET)

I'm creating a GUI that has 1 to many OpenGL view forms. Now the basics are working, I have a list of Viewer Forms and each encapsulates an OpenTK.GLControl member in its designer class. I need to get the actual cursor position in the window that I…
Garviel
  • 435
  • 1
  • 4
  • 16
2
votes
2 answers

Projecting a 3D point to 2D screen coordinate OpenTK

Using Monotouch and OpenTK I am trying to get the screen coordinate of one 3D point. I have my world view projection matrix set up, and OpenGL makes sense of it and projects my 3D model perfectly, but how to use the same matrix to project just one…
sinsro
  • 905
  • 7
  • 25
2
votes
1 answer

Garbage collection not working with OpenTK, or am I missing sufficient disposal?

Consider this class for a 3D model. I can have multiple instances of the class. I am able to add, and remove my 3D models in the scene. class My3DModel { int VertexArrayObject; int VertexBufferObject; int ShaderProgram; int…
IOviSpot
  • 358
  • 3
  • 19
2
votes
1 answer

Why is my code not rendering a very simple rectangle?

I am very new to both C# and OpenGL. So I apologize in advance for any stupid mistakes. I am trying to render a simple rectangle using OpenTK. I have followed a bunch of tutorials and started getting a grasp of what exactly needed to be done. In…
Lea
  • 55
  • 7
2
votes
1 answer

What is the correct way to bind Multiple Textures on OpenTK?

I tried to implement a simple test program following the OpenTK official tutorial (here) but I can't achieve any result. Following the exact coding sequence proposed my output is just a white square. I tried several patches such as avoiding the…
MaxC
  • 885
  • 7
  • 21