this post was submitted on 06 Oct 2023
0 points (50.0% liked)

C++

1783 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
 

I was using this OpenGL tutorial, and when i compile the program and execute it, it fails with the error "Failed to create context: Arguments are inconsistent" the code: https://pastebin.com/1hQJYHxe Im using Arch Linux with sway (Wayland) glxinfo output: https://pastebin.com/VXWtib2W

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago

I was digging around in the GLFW code a bit before I saw your comment, and the "Arguments are inconsistent" message seems to be how GLFW describes an EGL_BAD_MATCH error code. There's a few places in egl_context.c where getEGLErrorString is called that could return that string, but it's probably in _glfwCreateContextEGL given the "Failed to create context" part of the error quoted.

The error handling there (if this is the right place -- I would have also expected "EGL" in the message, but maybe OP dropped it) follows a failure of eglCreateContext. The reference documentation for that function here -- https://registry.khronos.org/EGL/sdk/docs/man/html/eglCreateContext.xhtml -- unfortunately doesn't give much detail about the kinds of errors that can happen, but does talk about OpenGL versions so a mismatch on that makes sense; I think this is on the right track.

Googling the OpenGL renderer string: llvmpipe (LLVM 16.0.6, 128 bits) line from the glxinfo output suggests that's software rendering, so the OpenGL version shown there may differ from what is actually supported by hardware rendering. Is there an EGL equivalent to glxinfo? (eglinfo, maybe?)

I'd personally comment out all the glfwWindowHint calls and see if a window shows up at all -- then mess with the OpenGL version if needed.