From the backtrace it can be seen, that problem is in the following block in open_gl.c:
// Create a pixel buffer object if supported
if (GLEW_VERSION_2_1 || GLEW_ARB_pixel_buffer_object || GLEW_EXT_pixel_buffer_object) {
glGenBuffers(1, &pbo);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
}
I tried to disable it using the following patch, since my hardware supports only OpenGL-1.4 and I assumed that maybe (just maybe) OpenGL-2.1 is required for this code to work properly:
--- freedroidrpg-1.0RC2/src/open_gl.c.orig 2019-05-12 18:03:36.000000000 +0300
+++ freedroidrpg-1.0RC2/src/open_gl.c 2019-11-07 11:46:24.199633336 +0300
@@ -309,7 +309,7 @@
glDepthFunc(GL_LEQUAL);
// Create a pixel buffer object if supported
- if (GLEW_VERSION_2_1 || GLEW_ARB_pixel_buffer_object || GLEW_EXT_pixel_buffer_object) {
+ if (GLEW_VERSION_2_1 && (GLEW_ARB_pixel_buffer_object || GLEW_EXT_pixel_buffer_object)) {
glGenBuffers(1, &pbo);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
}
With this patch this part of code works fine, but it segfaults in another place:
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0052423f in safely_set_some_open_gl_flags_and_shade_model () at open_gl.c:313
#2 0x00524318 in init_open_gl () at open_gl.c:335
#3 0x00492737 in set_video_mode_for_open_gl () at graphics.c:718
#4 0x00492a66 in init_video () at graphics.c:766
#5 0x004b6430 in InitFreedroid (argc=1, argv=0xbfffdbb4) at init.c:962
#6 0x004fb67f in main (argc=1, argv=0xbfffdbb4) at main.c:153
And I see no easy way to completely disable use of shaders. I compared 0.16 and 1.0rc2 opengl code and it seems that there were no shaders at all in 0.16. Maybe they should be optionally disabled for older hardware (e.g < OpenGL-2)?
I also considered that possibility that my OpenGL setup is broken, but another application using glew and OpenGL like scorched3d work just fine (slow of course, but without segfaults). So it is quite possible that something is amiss within the FreedroidRPG.
|