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

convert java lwjgl mouse rotation to c# opentk

im making a model viewer in C# and im having trouble getting the camera to move around a point... in java all i had to do was if (Mouse.isButtonDown(0) && !Mouse.isButtonDown(1)) { yaw -= (float) Mouse.getDX(); pitch…
user3441843
  • 137
  • 1
  • 7
0
votes
1 answer

How to Draw simple objects using OpenGL with a Mouse

I am trying to design a small application that could draw simple objects like lines,ellipses,triangles, etc... with a mouse using OpenGL. There should be a GUI which user can interact with. I thought of design the UI with C#. But I have problems…
amsandun
  • 3
  • 1
  • 4
0
votes
2 answers

Copy OpenGL back buffer directly onto GDI DC pixel data

I'm writting a GUI wich uses OpenGL via the OpenTK and the GLControl on C# and i'm trying to use dirty rectangles for drawing only the controls that need to be drawed. Obviusly it's not wise to redraw an entire maximized form just for refreshing a…
Rafael
  • 2,642
  • 2
  • 24
  • 30
0
votes
3 answers

C# ModelViewMatrix implementation using Stack vs. Uniform passing

I'm trying to rewrite my c++ code which implements non-fixed pipeline matrices to C#, using OpenTK. I'm encountering problems, as I don't understand why this code is invalid. static class ModelView { static private Stack matrix = new…
ddl
  • 329
  • 6
  • 15
0
votes
1 answer

how to make a 3D opengl drawn object respond to clicks

I have a cube in openTK (openGL C#) and I want it to respond to mouse clicks. Is there any inbuilt function to do this? I would be very glad to have some help on the subject as I cannot find the right keywords to find it in google. All I need is a…
Samuel Allan
  • 392
  • 2
  • 20
0
votes
1 answer

OpenTK GameWindow NotImplementedException

I'm getting a NotImplementedException in version 1.1 (stable release), the source has been included in the program, and not compiled to OpenTK.dll (single file app) without resources. I have done this before but not with version 1.1: public…
0
votes
1 answer

Do the Android and iOS versions of OpenTK have the same API?

I'm trying to get into mobile game development with Xamarin; I am using OpenTK for rendering. My plan is the following: 1. Make a shared library that is actually the game (and has all openTK code). 2. Make a a runnable project for iOS and Android…
sydd
  • 1,824
  • 2
  • 30
  • 54
0
votes
1 answer

How to design a game for multiple resolutions?

Trying to figure out a good solution for handling different resolutions and resizing in a 2D side-scrolling shooter game build with OpenTK (OpenGL). Ortho is setup as follows. private void Setup2DGraphics() { const double halfWidth =…
RB84
  • 331
  • 4
  • 15
0
votes
2 answers

GL.ClearColor function in openTK does not work

In a practice from CodeProject, I used C#; In my window form I select an GLControl from toolbox and put the code below in Resize and load event of this control, but when I run the project the form is blank. Where is the mistake? int w =…
0
votes
1 answer

GameViews in OpenTK-1.0 calling Destroy/CreateFramebuffer obliterates context...Why?

GameViews in OpenTK-1.0 initialize the context in CreateFramebuffer() and destroy said context in DestroyFramebuffer(). What if I want to hold onto my VBOs and just create a bunch of new FBOs? For example, on rotation, I need to create newly sized…
dan
  • 245
  • 4
  • 13
0
votes
1 answer

How to copy OpenGL viewport into a C# Bitmap

I'm trying to copy the contents of an OpenGL (using OpenTK) viewport into a C# Bitmap. I'm using this code: BitmapData data = bmp.LockBits(Rectangle.FromLTRB(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly,…
TrespassersW
  • 403
  • 7
  • 14
0
votes
0 answers

Geometry shader does simply not work on AMD cards

Simply my problem is that on NVIDIA cards, my openGL stuff works perfectly, on AMD cards it seems to completely jump the geometry shader. In my geo shader I had it so it adds an extra point to triangles to form a quad which is outputted as a…
0
votes
1 answer

Fullscreen blur GLSL shows diagonal line (OpenGL core)

In OpenGL 2.1, we could create a post-processing effect by rendering to a FBO using a fullscreen quad. OpenGL 3.1 removes GL_QUADS, so we have to emulate this using two triangles instead. Unfortunately, I am getting a strange issue when trying to…
The Fiddler
  • 2,726
  • 22
  • 28
0
votes
1 answer

Drawn quads, lines, points in opentk don't show up right

I've got drawing sprites to work with OpenTK in my 2d game engine now. Only problem I'm having is that custom drawn objects with opengl (anything but sprites really) show up as the background color. Example: I'm Drawing a 2.4f width black line…
Villermen
  • 815
  • 2
  • 13
  • 28
0
votes
1 answer

OpenGL/OpenTK backbuffer drawing lines with my own algorithm

I'm using OpenTK, which is OpenGL in C# so any answer in opengl is satisfying for me... I've got a 3D object, what i want to do is draw some lines (wireframe) and display only them (I know aobut GLPolygonMode - that's not what i want to do) I've got…
johns
  • 183
  • 1
  • 14