Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Mar 29, 2024 1:40 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Sep 28, 2008 9:47 pm 
Offline

Joined: Sun Sep 28, 2008 9:23 pm
Posts: 4
First at all: Sorry for my bad english. :wink:

In the configure script you are using the following code to test "The OpenGL Extension Wrangler Library"
Code:
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
int main(void) { glewInit(); return 0; }


I compiled that code successfully, but always get a segfault when I start the created binary.

I asked a friend to do the same on his machine, but there was all fine.
So I was using gdb:

Code:
gdb ./a.out
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /tmp/raydium/raydium-2008-09-28/a.out
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ae2930 (LWP 9948)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7ae2930 (LWP 9948)]
0xb80524f6 in glGetString () from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
(gdb) bt
#0  0xb80524f6 in glGetString () from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
#1  0xb7f6e7d3 in glewInit () from /usr/lib/libGLEW.so.1.5
#2  0x080484fa in main () at test.c:4
(gdb)


I thought it could be a problem with my driver/opengl implementation (mesa + r300), but "glewinfo" works fine.

So I spent a little time to read a few things.

When you have a look at http://glew.sourceforge.net/basic.html you will see how the right initialization should be done.

Quote:
First you need to create a valid OpenGL rendering context and call glewInit() to initialize the extension entry points.


So, when I use the example code there and call
Code:
glutInit(&argc, argv);
glutCreateWindow("GLEW Test");

before "glewInit()" all is fine.

Can you proof that?
When the developer of the glew library say that the correct initialization is this way, perhaps you should change it. :?:

"./raydium/init.c" should then also be changed.

Perhaps I am wrong - then explain me where is the mistake...


Last edited by maggu2810 on Fri Oct 10, 2008 8:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 9:57 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Hi,

Thanks a lot for this report. We used to call GLEW init before having any GL context since ages, without any trouble :)

I've updated the configure script (rev 774). The file init.c is OK, since raydium_init_engine() is called after window creation, by window.c. But we may have a problem with RAYDIUM_RENDERING_NONE mode. I'll have a check.

Can you test and confirm the fix is OK for you ?


Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 10:41 am 
Offline

Joined: Sun Sep 28, 2008 9:23 pm
Posts: 4
I checked out the revision 775 and the test of GLEW now (corrected the word 'no') works (that was to be expected).

Thanks.


Last edited by maggu2810 on Mon Sep 29, 2008 6:25 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 12:41 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
OK :) ... Not sure to understand why you're pleased with this GLEW failure on your system ... You don't have GLEW support ?


Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 2:15 pm 
Offline

Joined: Sun Sep 28, 2008 9:23 pm
Posts: 4
Code:
---------------------------
    GLEW Extension Info
---------------------------

GLEW version 1.5.0
Reporting capabilities of display :0.0, visual 0x21
Running on a Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE2 TCL from DRI R300 Project
OpenGL version 1.3 Mesa 7.2 is supported


I believe it is the drivers opengl implementation.
I tested it on two system, both with a current gentoo testing. One with the closed source nvidia driver (it works with only glewInit()) and one with the open source radeon driver (here we have to do the 'correct' way).

But when the developer of the glew library say that we have to create a valid opengl context, then it is perhaps a 'future', that the other drivers do it for you, to prevent a segfault.


Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 2:40 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I don't understand at all !.. :)

I just re-read your previous post and perhaps ...
maggu2810 wrote:
I checked out the revision 775 and the test of GLEW no works

... must be read ...
maggu2810 wrote:
I checked out the revision 775 and the test of GLEW now works

... so that would make all this way clearer for me :)


Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 6:26 pm 
Offline

Joined: Sun Sep 28, 2008 9:23 pm
Posts: 4
Sorry sorry sorry!
Yes, now it is working.


Top
 Profile  
 
 Post subject: Re: GLEW initialization
PostPosted: Mon Sep 29, 2008 7:36 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Fine ! thanks again for the report :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group