Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Bindings #40

Open
Fabi12345 opened this issue Sep 28, 2024 · 3 comments
Open

Initialize Bindings #40

Fabi12345 opened this issue Sep 28, 2024 · 3 comments

Comments

@Fabi12345
Copy link

Fabi12345 commented Sep 28, 2024

Hi
I get a runtime error when I run the Testform, it says you need to initialize the OpenGL binding first by calling LoadBindings().
Here is the full message:

System.InvalidOperationException: You need to initialize the OpenGL binding first by calling LoadBindings() or creating a compatible OpenGL window.
   at OpenTK.Graphics.BindingsBase.Uninitialized()
   at OpenTK.Graphics.OpenGL4.GL.Viewport(Int32 x, Int32 y, Int32 width, Int32 height)
   at OpenTK.GLControl.TestForm.Form1.glControl_Resize(Object sender, EventArgs e) in C:\Users\Dol_G_000\VisualStudio\repos\GLControl\OpenTK.GLControl.TestForm\Form1.cs:line 216
   at OpenTK.GLControl.TestForm.Form1.glControl_Load(Object sender, EventArgs e) in C:\Users\Dol_G_000\VisualStudio\repos\GLControl\OpenTK.GLControl.TestForm\Form1.cs:line 138
   at OpenTK.GLControl.GLControl.OnLoad(EventArgs e) in C:\Users\Dol_G_000\VisualStudio\repos\GLControl\OpenTK.GLControl\GLControl.cs:line 598
   at OpenTK.GLControl.GLControl.OnCreateControl() in C:\Users\Dol_G_000\VisualStudio\repos\GLControl\OpenTK.GLControl\GLControl.cs:line 587
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
System.Private.CoreLib
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.700.22.55902.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Private.CoreLib.dll.
----------------------------------------
OpenTK.GLControl.TestForm
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.GLControl.TestForm.dll.
----------------------------------------
System.Runtime
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Runtime.dll.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.800.122.30903.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/System.Windows.Forms.dll.
----------------------------------------
System.ComponentModel.Primitives
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.ComponentModel.Primitives.dll.
----------------------------------------
System.Drawing.Primitives
    Assembly-Version: 4.2.1.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Drawing.Primitives.dll.
----------------------------------------
System.Collections.Specialized
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Collections.Specialized.dll.
----------------------------------------
OpenTK.Mathematics
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.Mathematics.dll.
----------------------------------------
System.Runtime.InteropServices
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Runtime.InteropServices.dll.
----------------------------------------
System.Drawing.Common
    Assembly-Version: 4.0.2.3.
    Win32-Version: 4.700.21.51508.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/System.Drawing.Common.dll.
----------------------------------------
System.Threading
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Threading.dll.
----------------------------------------
System.Diagnostics.TraceSource
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Diagnostics.TraceSource.dll.
----------------------------------------
System.Collections
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Collections.dll.
----------------------------------------
System.Runtime.Extensions
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Runtime.Extensions.dll.
----------------------------------------
System.Diagnostics.Debug
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Diagnostics.Debug.dll.
----------------------------------------
Microsoft.Win32.Primitives
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/Microsoft.Win32.Primitives.dll.
----------------------------------------
System.ComponentModel.EventBasedAsync
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.ComponentModel.EventBasedAsync.dll.
----------------------------------------
System.Threading.Thread
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Threading.Thread.dll.
----------------------------------------
Accessibility
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.800.122.30903.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/Accessibility.dll.
----------------------------------------
System.ComponentModel.TypeConverter
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.ComponentModel.TypeConverter.dll.
----------------------------------------
System.Resources.ResourceManager
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Resources.ResourceManager.dll.
----------------------------------------
OpenTK.GLControl
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.GLControl.dll.
----------------------------------------
OpenTK.Windowing.Common
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.Windowing.Common.dll.
----------------------------------------
Microsoft.Win32.SystemEvents
    Assembly-Version: 4.0.2.0.
    Win32-Version: 4.700.19.56404.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/Microsoft.Win32.SystemEvents.dll.
----------------------------------------
System.Collections.Concurrent
    Assembly-Version: 4.0.15.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Collections.Concurrent.dll.
----------------------------------------
System.ComponentModel
    Assembly-Version: 4.0.4.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.ComponentModel.dll.
----------------------------------------
OpenTK.Windowing.Desktop
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.Windowing.Desktop.dll.
----------------------------------------
System.Collections.NonGeneric
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Collections.NonGeneric.dll.
----------------------------------------
System.Memory
    Assembly-Version: 4.2.1.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Memory.dll.
----------------------------------------
System.Buffers
    Assembly-Version: 4.0.5.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Buffers.dll.
----------------------------------------
System.Resources.Extensions
    Assembly-Version: 4.0.1.0.
    Win32-Version: 4.700.20.21406.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/System.Resources.Extensions.dll.
----------------------------------------
netstandard
    Assembly-Version: 2.1.0.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/netstandard.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.800.122.30903.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/System.Drawing.dll.
----------------------------------------
System.ObjectModel
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.ObjectModel.dll.
----------------------------------------
System.Linq
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Linq.dll.
----------------------------------------
System.Windows.Extensions
    Assembly-Version: 4.0.1.0.
    Win32-Version: 4.700.19.56404.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/System.Windows.Extensions.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.800.122.30903.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/3.1.32/de/System.Windows.Forms.resources.dll.
----------------------------------------
System.Runtime.InteropServices.RuntimeInformation
    Assembly-Version: 4.0.4.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Runtime.InteropServices.RuntimeInformation.dll.
----------------------------------------
System.Diagnostics.Process
    Assembly-Version: 4.2.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Diagnostics.Process.dll.
----------------------------------------
OpenTK.Graphics
    Assembly-Version: 4.0.0.0.
    Win32-Version: 4.0.0.0.
    CodeBase: file:///C:/Users/Dol_G_000/VisualStudio/repos/GLControl/OpenTK.GLControl.TestForm/bin/Debug/netcoreapp3.1/OpenTK.Graphics.dll.
----------------------------------------
System.Private.Uri
    Assembly-Version: 4.0.6.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Private.Uri.dll.
----------------------------------------
System.Diagnostics.StackTrace
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Diagnostics.StackTrace.dll.
----------------------------------------
System.Reflection.Metadata
    Assembly-Version: 1.4.5.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Reflection.Metadata.dll.
----------------------------------------
System.IO.FileSystem
    Assembly-Version: 4.1.2.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.IO.FileSystem.dll.
----------------------------------------
System.Collections.Immutable
    Assembly-Version: 1.2.5.0.
    Win32-Version: 4.700.22.56512.
    CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/3.1.32/System.Collections.Immutable.dll.
----------------------------------------


I also have a project which I updated from 3.3.3.0 to 4.0.0.0 and got the same issue.

Windows 10
Radeon RX 580
AMD Ryzen Threadripper 1920X 12-Core Processor 3.50 GHz
Tag 4.0.1 (compiled and unmodified)

@NogginBops
Copy link
Member

What version of the GLControl are you using? How are you running the code?

@Fabi12345
Copy link
Author

I tried the two latest tags 4.0.0 and 4.0.1, same result.
Compiled and run in Visual studio 2022, but also tried the bash file with .nuke.
I tried different configurations of the profile and API in the designer form...with no effect.

@Fabi12345
Copy link
Author

Fabi12345 commented Sep 29, 2024

When in the glControl_Load(), the glControl.Context is still null, I think this is troublesome.
glcontrol variable
Bindingcontext is set somehow, but maybe it should bind to OptenTK.IBindingsContext and not System.Windows.Forms.BindingContext, that's at least what it says when I try to bind it manually, cannot convert.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants