#Simple GLFW program that creates window and OpenGL resulting in driver error

26 messages · Page 1 of 1 (latest)

timid sleet
#

Hey y'all, I'm super new to graphics programming and I am currently following the guide on learnopengl.com.

I followed the instructions and setup my project on Visual Studio 2022. To test out that all libraries and dependencies are installed correctly before moving ahead, I am trying to run the example program found on GLFW's documentation (https://www.glfw.org/documentation.html) which creates a window and sets up an OpenGL context

I have added the include files and the .lib files in my project settings as instructed. However, when I run the program, it terminates with a -1 during glfwCreateWindow().

Upon adding more logging to this program, turns out this is the error causing it: " WGL: The driver does not appear to support OpenGL"

I have a laptop with dual GPU: RTX 4050 and AMD Radeon 780M.

So far, I have updated both my graphic drivers to the latest version and also forced windows to always use RTX 4050. But I am still facing this issue and I'm honestly stuck. Most of the solutions on google are for Minecraft and it's as simple as downloading opengl32.dll and adding it to your java folder.

I'd really appreciate it if someone could point me in a direction of what could be going wrong.

rocky marlin
#

@timid sleet can you show the code that isn't working? preferably in the form of a min repro

#

maybe you're calling things in the wrong order or omitting some calls

#

(also, don't download dlls from the internet except from official sources)

timid sleet
rocky marlin
#

ah, my bad for not comprehending you the first time

#

are you on windows?

#

I suppose you could try using a debugger to step into glfwCreateWindow to see what it's doing

timid sleet
#

Yep

timid sleet
#

It fails because opengl is not supported by my gpu driver apparently

#

That’s all I could find after lots of debugging unfortunately

rocky marlin
#

that's odd

#

I suspect something is wrong with either your drivers or how windows is configured to select a gpu

vapid drift
#

This example doesn't set an OpenGL version, and relies on the native context to load basic functions

rocky marlin
#

I know you checked both, but idk what else it could be

vapid drift
#

I'd use glad (glad 2 is out now) to load, and set a version to start with (at least 3.3 core)
LearnOpenGL covers using glad (v1 at least)

timid sleet
#

Hmm

#

I’ll try it with glad. Thanks Darian

timid sleet
vapid drift
#

I mean the natively loaded gl functions even

#

which are used to bootstrap an opengl context

#

but everything interesting needs a loader anyway

#

The webservice is in the github readme that generates the files, just select Core instead of Compatibility, and whatever gl version you want

timid sleet
#

Gotcha