opentk / GLControl

WinForms control for OpenTK 4.x.
https://opentk.net
Other
54 stars 24 forks source link

Form not showing: The program has exited with code -1073740791 (0xc0000409). #19

Closed ejongejans closed 2 years ago

ejongejans commented 2 years ago

Hi,

I have a problem with running the GLControl on my PC (updated win10, intel HD graphics). Whatever I try it's not starting up with .net3.1, .net6. It does not happen on a different development PC; but it also does not happen using .NET framework. So I'm a bit hestitant to blame it on the graphics driver or pc.. perhaps it's .NET core?

Each time after the form is shown, but before the onShown event of the form triggers i get a hard exception: The program '[15824] OpenTK.WinForms.TestForm.exe' has exited with code -1073740791 (0xc0000409). And the application terminates.

It happens with my own applications; but currently it also happens when running OpenTK.Winforms.TestForm from this repo. Everything compiles fine.

I've been using OpenTK/GLControl for a long time with .Net Framework succesfully. Whenever I use these it works fine. When I switch to .NET3.1/.NET6 with the exact same simple example (just loading a form and gl.clear the background red) it will yield this strange error on startup..

Attached 2 images of the problem. I'm a bit stuck at this point at where to look further..

image

image

NogginBops commented 2 years ago

I'm guessing you are using version 3.1 of this package? That version only works on .net framework.

There is a GLControl for OpenTK 4 and .net core here.

ejongejans commented 2 years ago

No i'm using the latest package as you describe. I tested with the sample project from github. Just to be sure; i made an empty .NET6 project, installed the nuget you referenced and typed up a simple form. The screenshot shows all there is.. and the error.

Going to try another laptop and reinstall graphics drivers. (still updating drivers should not be a solution i guess... ) I'll also test OpenTK running on .NET6 with a native windows; see if the problem is there as well.

image

ejongejans commented 2 years ago

GameWindow only (no glcontrol) same issue.. (sample code from here: https://github.com/Rabbid76/c_sharp_opengl/blob/master/OpenTK_hello_triangle/Program.cs )

image

ejongejans commented 2 years ago

So it appeared to be an opengl problem. After updating the drivers the problem dissappeared.

The problematic driver is this one: (installed on an Acer TC-780 desktop with i5 7400 processor. image

After updating with the latest from the intel website and manually installing the driver (iigd_dch.inf file) image

My laptop (intel hd 620) has driver version 27.20.100.9749 and doesn't seem to have the problem.

seanofw commented 2 years ago

Intel’s graphics drivers are well-known to be glitchy, so this really doesn’t surprise me. It’s not the fist time I’ve seen their drivers behaving in weird unpredictable ways, and it probably won’t be the last: I had to outright rewrite some of my shaders just so they’d work on my one Intel laptop. Worked fine on one, crashed badly on the other, both with Intel chipsets of similar years (in fact, the slightly older chipset was the less buggy one!).

So for anybody who encounters this in the future and has an Intel graphics chip, update your drivers first before doing anything else.

ejongejans commented 2 years ago

I remember now I had a similar problem with shaders on the exact same PC, years ago. (2017 drivers from intel). For some reason it couldn't deal correctly with a flat array of vertices in an VBO. (instead of an indexed array) It would show artifacts every once in a while. I ended up just ignoring it and didn't have any other reports of somebody having artifacts. But it never resolved..

thx for the feedback either way!