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
0
votes
2 answers

opentk glcontrol auto render?

So I have this nice c# application written with OpenTK (OpenGL) ... it uses a full screen GL Window and like it's supposed to, it auto runs the OnRenderFrame method whenever it can, and I get a great 60 FPS game. BUT, now I wish to use my game…
stingray-11
  • 448
  • 2
  • 7
  • 25
0
votes
2 answers

How to get stuff to show up in my window?

I've been playing with OpenGL. I'm confused because most commands seem to call a static method instead of the window object I create - by what arcane methods does the compiler divine my target window, I can't fathom. I assume I've misunderstood…
Fadeway
  • 549
  • 5
  • 18
0
votes
2 answers

OpenGL Clipping, depth and camera

Having trouble with clipping/view not sure Im simply trying to rotate and scale a rectangular box (of lines not quads) in a windows form (using OpenTK) This is simple enough but When i zoom/scale parts of the line get clipped when they…
Kedar
  • 1
  • 2
0
votes
1 answer

Sharing values between kinect class and opentk onrenderframe class

I use Kinect and OpenTK in my application. In one class I use WindowLoaded method, which in loop calls SensorSkeletonFrameReady and write to console computed coordinates of right hand. In main window class I call OnRenderFrame, which in loop draws…
0
votes
0 answers

SpriteBatch.End() throws OpenTK.Graphics.GraphicsErrorException: InvalidEnum

I decided to begin game development with MonoGame but I am facing a problem. When I try to add a sprite to the screen with a SpriteBatch object like I can read in many XNA tutorial, I get an OpenTK.Graphics.GraphicsErrorException. protected…
dgellow
  • 692
  • 1
  • 11
  • 18
0
votes
2 answers

Darken whole screen

I'm working on a game using OpenTK in C#. Currently trying to implement the pause menu system. One feature, that I need your help with, is darkening the whole screen when the menu appears. Is there any way i can do a final modification of every…
Joel
  • 1,580
  • 4
  • 20
  • 33
0
votes
1 answer

Asynchronous image drawing with OpenTK

I got a scene on which I execute some commands. Lets suppose I want to make a simulation and every step of it, I can do sth like that. private void button4_Click(object sender, EventArgs e) { commands[global++].Execute(ref area.heightMap, ref…
rank1
  • 1,018
  • 4
  • 16
  • 37
0
votes
1 answer

Using OpenTK (z-indexing)

I'm doing a cross between following some NeHe tutorials (translating it to OpenTK) and an OpenTK sample I found online to draw a triangle (for a simple initial setup): using System; using System.Collections.Generic; using System.Linq; using…
0
votes
1 answer

OpenGL/TK TexSubImage2D can't modify transparent pixel

I have loaded in an image with this method: public static int LoadTexture(string file) { Bitmap bitmap = new Bitmap(file); int tex; GL.GenTextures(1, out tex); GL.BindTexture(TextureTarget.Texture2D, tex); …
Joel
  • 1,580
  • 4
  • 20
  • 33
0
votes
1 answer

OpenGL/TK Modify change single pixel of image

I want to change a single pixel of the bound texture. I know i could have a 1x1 bitmap, and get the bitmap data of that, and then pass that in: GL.TexSubImage2D(TextureTarget.Texture2D, 0, pixel.X, pixels.Y, 1, 1,…
Joel
  • 1,580
  • 4
  • 20
  • 33
0
votes
1 answer

OpenTK GL.VertexAttribPointer() call producing INVALID_OPERATION error

I'm calling GL.VertexAttribPointer on my first vertex attribute, and the call is producing an INVALID_OPERATION error. I don't know what that means, as the OpenGL API doesn't list that as one of the errors a VertexAttribPointer call can make:…
jwrush
  • 743
  • 7
  • 25
0
votes
1 answer

Throttle Geometry in OpenGL (OpenTK)

I've been working on a client for Minecraft Classic in C# using the OpenTK library (OpenGL) and I have a problem. When the client receives a SetBlock packet, it will draw the block in the same way as when you place a block, but when a cuboid happens…
Jonty800
  • 482
  • 7
  • 20
0
votes
1 answer

Splitting string as double array

I have a problem : I have a string containing values and I want to split them into a double array . The input : 0.0 0.0 0.0 I have two ways but both are not working First : Dim arrString As String() = line.Split(New Char() {"…
Bnkl
  • 7
  • 1
  • 5
0
votes
2 answers

why gl.vector3 doesn't work?

I want to show a pixel in the screen.I use openTk in Vs2010. this is my code in Windows form application: private void glControl1_Load(object sender, EventArgs e) { OpenTK.Graphics.OpenGL.GL.ClearColor(Color.DeepSkyBlue); …
0
votes
1 answer

C# OpenTK GLSL Crashing on attempting to render

I've been trying to implement GLSL into my program, however given that i have never used GLSL before, i decided I would try following a tutorial. Unfortunately following tutorials aren't my forte, and I am stuck here with my program crashing when…
Joel
  • 1,580
  • 4
  • 20
  • 33