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

Is the Tao framework dead?

I'm looking into experimenting with Tao but I am somewhat put-off by its dead-looking state. It hasn't been updated since 2008 and it looks like their website stopped functioning at roughly the same time. Does anyone have any information on the…
Tom Savage
  • 3,172
  • 4
  • 31
  • 31
23
votes
2 answers

C# performance profiler shows long pause, unable to determine what it is from the data provided

I am getting an unexpected spike in my C# application when rendering frames. I have been going over it in a profiler and I noticed the following: When vsync is on, the program seems to relinquish control to the OS (or does something) when swapping…
Water
  • 3,245
  • 3
  • 28
  • 58
21
votes
3 answers

How to join overlapping circles?

I want to visually join two circles that are overlapping so that becomes I already have methods for partial circles, but now I need to know how large the overlapping angle for earch circle is, and I don't know how to do that. Anyone got an Idea?
Cobra_Fast
  • 15,671
  • 8
  • 57
  • 102
12
votes
2 answers

OpenTK, SharpGL and WPF

I am about to begin a new project. Some decisions are out of my control: Using WPF and OpenGL are some of them. However, I have narrowed down my OpenGL options to two: Either OpenTK or SharpGL. SharpGL has a WPF control, while OpenTK only has a…
Gilad
  • 343
  • 1
  • 3
  • 13
10
votes
1 answer

Convert ImageSharp.Image to ImageSharp.PixelFormats.Rgba32?

I am following a tutorial (https://opentk.net/learn/chapter1/4-textures.html) using ImageSharp. How do I convert the type 'ImageSharp.Image' to 'ImageSharp.PixelFormats.Rgba32'? To load the Image, I am using Image image = Image.Load(path);…
Tiarnan
  • 115
  • 1
  • 10
9
votes
1 answer

C# SkiaSharp OpenTK Winform - How to draw from a background thread?

I am trying to replace GDI+ with SkiaSharp for a data visualization framework that renders multi-layered pannable-zoomable graphs with real-time continuously changing engineering data. In GDI+, the application did this: Created a collection of…
user1689175
  • 767
  • 10
  • 18
8
votes
1 answer

Open TK difference onRenderFrame and onUpdateFrame?

I am currently programming a Jump n' Run game in C# using OpenTK Framework and OpenGL. Open TK provides preset functions like GameWindow.Run(); or GameWindow.onUpdateFrame(); onRenderFrame(); As far as i thought through it, all actions that draw…
user3605638
  • 207
  • 1
  • 5
  • 11
8
votes
1 answer

OpenGL C# (OpenTK) Load and Draw Image functions not working

I'm trying to load and display a texture on the screen, however am receiving a black box where it is meant to be shown. The two main methods are "LoadTexture" and "Draw Image", I'm assuming the mistake is in one of them. using System; using…
Joel
  • 1,580
  • 4
  • 20
  • 33
7
votes
1 answer

Why is my PNG texture not coming out with transparency?

The bottom right image should have a transparent background. I load my Notch's PNG via these functions: public void Image2D(Bitmap bmp, int mipmapReductionLevel = 0) { var rect = new Rectangle(0, 0, bmp.Width, bmp.Height); var data =…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
7
votes
3 answers

How can I use screen space coordinates directly with OpenGL?

I've follow the guide I find on https://learnopengl.com/ and managed to render a triangle on the window, but this whole process just seems over complicated to me. Been searching the internet, found many similar questions but they all seem outdated…
RadarNyan
  • 306
  • 1
  • 2
  • 12
7
votes
0 answers

OSX Custom Shaped OpenGL / OpenTK View

On OSX have a custom transparent window, with a NSView inside of it that manages OpenGL drawing: public class MyCustomOpenGLView : NSView { NSOpenGLContext openGLContext; // ... } I have set the following (using…
Bob
  • 821
  • 1
  • 17
  • 36
7
votes
1 answer

Simple OpenTK Shader not working

I'm currently trying to get into GLSL using the OpenGL superbible and http://www.learnopengl.com/. My desired environment is OpenTK. I tried to convert the "Hello Triangle" entry level tutorial from learnopengl.com into OpenTK, it is meant to draw a…
Sors
  • 494
  • 1
  • 4
  • 12
6
votes
1 answer

How do I make a custom vertex format with OpenGL

I am writing my own engine using OpenTK (basically just OpenGL bindings for C#, gl* becomes GL.*) and I'm going to be storing a lot of vertex buffers with several thousand vertices in each. Therefore I need my own, custom vertex format, as a Vec3…
Azzi777
  • 157
  • 2
  • 6
6
votes
2 answers

Smoother gradient transitions with OpenGL?

I'm using the following shader to render a skydome to simulate a night sky. My issue is the clearly visible transitions between colours. What causes these harsh gradient transitions? Fragment shader: #version 330 in vec3…
livin_amuk
  • 1,285
  • 12
  • 26
6
votes
6 answers

Runtime code injection using DynamicMethod?

Consider the following trivial code: using System; class Test { delegate int FooDelegate(int i); FooDelegate Foo = FooImplementation; static int FooImplementation(int i) { return i + 1; } public static void…
The Fiddler
  • 2,726
  • 22
  • 28
1
2 3
64 65