nukeykt/NBlood

[NBlood] OpenGL support on Raspberry Pi 4

vanfanel opened this issue · 4 comments

Hello,

I just built latest NBlood on GNU/Linux aarch64 (Raspberry Pi 4, latest stable MESA) with OpenGL support.
It built and linked with no problem, by doing:

make blood -j3 USE_OPENGL=1

But when running the engine I get:


1.6992s ERROR| Unable to set video mode: SDL_GL_CreateContext failed: Could not create EGL context (call to eglCreateContext failed, reporting an error of EGL_BAD_ATTRIBUTE).                                               
 1.6993s ERROR| Video driver does not support OpenGL version 2 or greater; all OpenGL modes are unavailable.

But that's NOT true at all. The Pi4 supports desktop OpenGL up to version 2.1, and GLES up to 3.1.

Tried to fix it by editing source/build/src/sdlayer.cpp and adding these flags before SDL_GL_ATTRIBUTES(i, sdlayer_gl_attributes):


             { SDL_GL_CONTEXT_MAJOR_VERSION, 2 }, 
              { SDL_GL_CONTEXT_MINOR_VERSION, 0 },

Also tried with { SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES },, but it's still complaining about my driver not having OpenGL 2 compatibility, which as I said is false.

Any idea on what's going on here? Maybe it's trying to initialize an OpenGL 3.x context? Where? How?

Have you tried switching the OpenGL Driver in raspi-config ?

@Jan200101 As I said, I am using MESA, which provides the up-to-date full/desktop OpenGL 2.1 support.
Ther legacy closed-source Broadcom driver isn't even installed on the system at all.

Same here on raspberry pi os 64 bit, same issue with nblood and eduke32 alike

midzer commented

glClientWaitSync is available only if the GL version is 3.2 or greater.

glClientWaitSync and few other functions need a GL Version higher than 2.1