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

Silent crash if OpenGL version is lower than 3.2 #23

Open
tpimh opened this issue Mar 19, 2022 · 3 comments
Open

Silent crash if OpenGL version is lower than 3.2 #23

tpimh opened this issue Mar 19, 2022 · 3 comments

Comments

@tpimh
Copy link
Contributor

tpimh commented Mar 19, 2022

I have tried to build CadZinho with MSVC (VS2019 for both x64 and x86). These are the libraries that I was using:

The executable launches, but crashes with this error:

Access violation - code c0000005
eax=00000000 ebx=00000001 ecx=4e3a7c0a edx=7473bd44 esi=04bc9378 edi=04bc4a28
eip=00000000 esp=04afe018 ebp=04afe058 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210246
00000000 ??              ???

With a debugger, I figured out that this is the exact line that crashes:

glGenVertexArrays(1, &vao);

How can I debug further to provide valuable information?

@tpimh
Copy link
Contributor Author

tpimh commented Mar 20, 2022

I think the problem is actually with my Windows machine, because I have tried a lot of different combinations of libraries, tried building with MINGW and MSVC, and all produced binaries fail exactly the same. Also, tried precompiled version by @zYg-sys, same result. Not really sure what I am missing, as other OpenGL software runs just fine.

@zecruel
Copy link
Owner

zecruel commented Mar 20, 2022

Hi @tpimh .

It could be a problem with the video card driver on your machine. It has been reported that some default drivers on Windows only support older versions of OpenGL. Try to update the drivers with the official version of the video card manufacturer.

The OpenGL version used in CadZinho is 3.2. It's the same one used in Blender 3D, if you want to test another application.

Another possible cause, which I think is unlikely, is the incompatibility of the GLEW DLL, which may have been compiled for another architecture.

@tpimh
Copy link
Contributor Author

tpimh commented Mar 20, 2022

Yes, this was the case! I checked, and my OpenGL version showed OpenGL 1.1, which after the driver update became 3.3, and CadZinho started just fine. I will update the title of the issue now.

Maybe it's a good idea to implement an OpenGL version check before trying to create context? glGetString(GL_VERSION) should be easy to parse, but maybe there is a way to get major and minor versions separately.

@tpimh tpimh changed the title Windows executable crashes on glGenVertexArrays Silent crash if OpenGL version is lower than 3.2 Mar 20, 2022
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