Closed dfkeenan closed 3 years ago
Thank you for the bug report 🤗
I have updated the opentk4.0
branch to use the latest pre-released of OpenTK.
The issue was that OpenTK 4-pre9.4 doesn't automatically make a opengl context "current" on the main thread, this doesn't happen in the later pre-releases so I needed to add a call to MakeCurrent()
in the OnLoad
method.
Because there was no context current all of the opengl calls where invalid operations and the buffers null, so the call do draw had no data, hence the AccessViolation.
Try it out and see if that fixed the issue you where having 🙂
It works. \o/ Thank You!!
This is my first time playing with OpenGL and ImGui. I had no idea what to even look for. :D
Hi,
I was trying to use this sample with the latest NuGet packages. After updating
OpenTK
to4.0.0-pre9.4
andImGuiNet
to1.78.0
. I started gettingSystem.AccessViolationException
in theImGuiController.RenderImDrawData
method. I thought I might have broken something when I copied the code. So I downloaded theopentk4.0
branch. I updated the NuGet packages and changed theOpenToolkit
namespaces toOpenTK
and got the same error.The error happens with the call to
GL.DrawElementsBaseVertex
.https://github.com/NogginBops/ImGui.NET_OpenTK_Sample/blob/3e45958946c8f1ad8c4b1c6e543662a563769c55/Dear%20ImGui%20Sample/ImGuiController.cs#L372