-
Hello again, I'm running into a Runtime problem (Windows 10 - VS2019 pro ) Here is my code
However, on the last line, I get a Runtime exception :
I tried openning a window first with GLFW, and creating the context in various ways, but no luck. Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Anyone with a working example of Silk.NET GLFW + OpenGL ? |
Beta Was this translation helpful? Give feedback.
-
var gl = GL.GetApi(glfw.Context); You're trying to use the context we use to load GLFW to load OpenGL functions, which won't work. Instead, you need to create a context which hooks into var gl = GL.GetApi(glfw, myCoolWindowPointer); Where myCoolWindowPointer is obtained by |
Beta Was this translation helpful? Give feedback.
You're trying to use the context we use to load GLFW to load OpenGL functions, which won't work. Instead, you need to create a context which hooks into
glfwGetProcAddress
. Luckily, we've already done this for you. Try this line:Where myCoolWindowPointer is obtained by
glfw.CreateWindow
. You can't create aGlfwContext
until you have a window on-screen.