Forums

Full Version: GLEW initialization
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could it be, that you are using glewInit() before you create a valid OpenGL context?

I described the problem here:

http://memak.raydium.org/viewtopic.php?f...&sk=t&sd=a
Here (in your project) it is no problem with the configuration of the sources, but I get a segfault when I prepare to start the game and I believe the source of the problem is the same.

note:
the link for the developer faq do not work - error 404 -
http://vdrift.sourceforge.net/faqman/ind...at&c=2
I checked and the opengl context is created before glew is initialized, at least in the 8-5-08 release. Could you post more information about your crash? What console messages are printed, when does the crash occur, what gfx card/OS are you using, which release are you using, and have you tried running gdb?
Code:
uname -a
Code:
Linux walkuer 2.6.26-gentoo #5 PREEMPT Tue Aug 5 13:41:46 CEST 2008 i686 Mobile AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

Code:
/usr/sbin/lspci -nn | grep VGA
Code:
01:00.0 VGA compatible controller [0300]: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10] [1002:4e50]


Code:
vdrift
Code:
No data_dir found in VDrift.config, using //usr/share/games/vdrift
Found config file /home/maggu2810/.vdrift/controls.config.
Found config file /home/maggu2810/.vdrift/VDrift.config.
No data_dir found in VDrift.config, using //usr/share/games/vdrift
Version of game: 2008-09-30-full
Skin name not found in config file...
//usr/share/locale
Run with -verbose for troubleshooting.
Run with -nosound to disable sound.
Run with -benchmark to play a replay and output benchmark data.
0 joystick(s) found:
libGL: XF86DRIGetClientDriverName: 5.3.0 r300 (screen 0)
libGL: OpenDriver: trying /usr/lib/dri/tls/r300_dri.so
libGL: OpenDriver: trying /usr/lib/dri/r300_dri.so
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 22, (OK)
drmOpenByBusid: Searching for BusID pci:0000:01:00.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 22, (OK)
drmOpenByBusid: drmOpenMinor returns 22
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
Extension not supported: GL_EXT_framebuffer_object
Card supports: drawbuf0 auxbuf0 antialiasing anisotropy16 cubemapping shaders multitexturing8(8) texture_rectangle depth_texture shadow
Card does not support: framebuffer_objects
Status: Using GLEW 1.5.0
OpenGL error during graphics init
Fragment shaders enabled
Segmentation fault

Between the two lines
Code:
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
Extension not supported: GL_EXT_framebuffer_object
a window is shortly appearing (only a black background and no foreground).

I am using (at the moment) the games-sports/vdrift-20080805 ebuild from gentoo.

I can prepare a checkout to the latest version, but because I do not found any bug reports about this problem in the net, I believe it is a uncommon thing (so I thought it was the same problem described above).

What for informations are helpfull for you?

Started gdb, run the game, ...
Code:
...
...
Status: Using GLEW 1.5.0
OpenGL error during graphics init
Fragment shaders enabled

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb78ed710 (LWP 11550)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x080ece13 in SHADER::Load ()
#2  0x080ee025 in SHADER_MANAGER::Load ()
#3  0x080593d7 in GRAPHICS::Init ()
#4  0x080603e2 in GAME::Start ()
#5  0x08051696 in main ()
Hey, thanks for all of the info. I suspect this is an issue with use of shaders. For some reason, a few types of graphics cards seem to compile the shaders fine but then crash when they're enabled. I think it's an issue with how I'm detecting success/failure. Anyway, try editing your ~/.vdrift/VDrift.config file and changing "shaders = true" to "shaders = false".
To edit the configuration file solved the problem.
Perhaps you are able to use another detection...
I can proof the code than on my system for tests.
Thanks
Same problem and same solution here, running windows XP SP2 and the .exe version 2008-08-05-full.

But I tried to compile it under ubuntu using the svn version with no success.. will try again later at home.

cya.
What kind of graphics card do you have?