Thread: [Super-tux-devel] OpenGL fix
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-05-04 11:58:15
|
Hey there, I ask for those that have OpenGL problems (looking at Keir Lawson) to try to do this: replace all 'screen->w' and 'screen->h' by 'SCREEN_W' and 'SCREEN_H', respectively (and without the ' ). I'm not sure if there is a command line to do this, but you can detect the files that use those, by running: grep 'screen->w' * And then, just make use of a text editor to replace them. Maybe Kate allows you to do replacements in multiple files... Just one thing, you could also try to print the screen->w and screen->h values in the st_video_setup_gl() on setup.cpp . For those that are wondering "Why the hell does that replacement will fix the OpenGL problem?". Here goes the answer: When asking for SDL to setup the video mode, the SDL returns a SDL_Surface structure that contains a few info about the screen and even allows pixel manipulation (in SDL mode). But in case, you ask SDL for an OpenGL video mode, there are a lot of variables that are not reliable and that can include the display's width and height. Cheers, Ricardo Cruz -- Don't I know you? |
From: Keir L. <ke...@th...> - 2004-05-04 19:45:28
|
On Tue, 2004-05-04 at 12:46 +0100, Ricardo Cruz wrote: > Hey there, > > I ask for those that have OpenGL problems (looking at Keir Lawson) to try to > do this: replace all 'screen->w' and 'screen->h' by 'SCREEN_W' and > 'SCREEN_H', respectively (and without the ' ). tried that... on make i get: badguy.cpp: In member function `void BadGuy::action_mriceblock(double)': badguy.cpp:264: error: `SCREEN_W' undeclared (first use this function) badguy.cpp:264: error: (Each undeclared identifier is reported only once for each function it appears in.) badguy.cpp: In member function `virtual void BadGuy::action(double)': badguy.cpp:671: error: `SCREEN_H' undeclared (first use this function) make[1]: *** [badguy.o] Error 1 make[1]: Leaving directory `/home/keir/supertux/src' make: *** [all-recursive] Error 1 Keir Lawson |
From: Ricardo C. <ri...@ae...> - 2004-05-04 22:36:45
|
Well, you should firstly have checkout the last cvs... Anyway, you just need to remove defines.h and do the checkout. In case it still happens (sometimes the sourceforge cvs takes a while to b= e=20 updated for ppl that do not have direct access), just add these lines to=20 defines.h : #define SCREEN_W 640 #define SCREEN_H 480 Please, do it... Let's cross the fingers ;) Ricardo Cruz Em Ter=E7a, 4 de Maio de 2004 20:44, o Keir Lawson escreveu: > On Tue, 2004-05-04 at 12:46 +0100, Ricardo Cruz wrote: > > Hey there, > > > > I ask for those that have OpenGL problems (looking at Keir Lawson) to > > try to do this: replace all 'screen->w' and 'screen->h' by 'SCREEN_W' a= nd > > 'SCREEN_H', respectively (and without the ' ). > > tried that... on make i get: > badguy.cpp: In member function `void BadGuy::action_mriceblock(double)': > badguy.cpp:264: error: `SCREEN_W' undeclared (first use this function) > badguy.cpp:264: error: (Each undeclared identifier is reported only once > for > each function it appears in.) > badguy.cpp: In member function `virtual void BadGuy::action(double)': > badguy.cpp:671: error: `SCREEN_H' undeclared (first use this function) > make[1]: *** [badguy.o] Error 1 > make[1]: Leaving directory `/home/keir/supertux/src' > make: *** [all-recursive] Error 1 > > > Keir Lawson > > > =2D-=20 There's a trick to the Graceful Exit. It begins with the vision to recognize when a job, a life stage, a relationship is over -- and to let go. It means leaving what's over without denying its validity or its past importance in our lives. It involves a sense of future, a belief that every exit line is an entry, that we are moving on, rather than out. The trick of retiring well may be the trick of living well. It's hard to recognize that life isn't a holding action, but a process. It's hard to learn that we don't leave the best parts of ourselves behind, back in the dugout or the office. We own what we learned back there. The experiences and the growth are grafted onto our lives. And when we exit, we can take ourselves along -- quite gracefully. -- Ellen Goodman |
From: Keir L. <ke...@th...> - 2004-05-05 19:42:59
|
On Tue, 2004-05-04 at 23:25 +0100, Ricardo Cruz wrote: > Well, you should firstly have checkout the last cvs... > Anyway, you just need to remove defines.h and do the checkout. > > In case it still happens (sometimes the sourceforge cvs takes a while to be > updated for ppl that do not have direct access), just add these lines to > defines.h : > > #define SCREEN_W 640 > #define SCREEN_H 480 > > Please, do it... Let's cross the fingers ;) > > Ricardo Cruz checked out the latest CVS, changed all screen->h/w to SCREEN_H/W, it compiled ok put the opengl problem still persists Keir Lawson |
From: Ricardo C. <ri...@ae...> - 2004-05-06 11:55:57
|
Could you just add these two lines to the final of the st_video_setup_gl() func in setup.cpp : std::cerr << "screen->w: " << screen->w << endl; std::cerr << "screen->h: " << screen->h << endl; And send the output. Thanks, Ricardo Cruz Em Quarta, 5 de Maio de 2004 20:43, o Keir Lawson escreveu: > On Tue, 2004-05-04 at 23:25 +0100, Ricardo Cruz wrote: > > Well, you should firstly have checkout the last cvs... > > Anyway, you just need to remove defines.h and do the checkout. > > > > In case it still happens (sometimes the sourceforge cvs takes a while to > > be updated for ppl that do not have direct access), just add these lines > > to defines.h : > > > > #define SCREEN_W 640 > > #define SCREEN_H 480 > > > > Please, do it... Let's cross the fingers ;) > > > > Ricardo Cruz > > checked out the latest CVS, changed all screen->h/w to SCREEN_H/W, it > compiled ok put the opengl problem still persists > > Keir Lawson > > > -- As Gen. de Gaulle occassionally acknowledges America to be the daughter of Europe, so I am pleased to come to Yale, the daughter of Harvard. -- J.F. Kennedy |
From: Keir L. <ke...@th...> - 2004-05-06 20:04:37
|
On Thu, 2004-05-06 at 12:44 +0100, Ricardo Cruz wrote: > Could you just add these two lines to the final of the st_video_setup_gl() > func in setup.cpp : > > std::cerr << "screen->w: " << screen->w << endl; > std::cerr << "screen->h: " << screen->h << endl; > > And send the output. well that line made it fail to compile (didnt like the endls, something about them being undefined or something), i removed the ,, endl bit and it compiled but nothing extra was outputted, however std::cerr << "screen->h/w: " << SCREEN_H/W; gave me the following extra output: screen->w: 640screen->h: 480 Keir Lawson |
From: Ricardo C. <ri...@ae...> - 2004-05-06 21:50:36
|
Oh, right. You just needed to replace endl by std::endl, I am used to put 'using std::endl;' in the beginning of my code... Anyway, if you have used: std::cerr << "screen->w: " << SCREEN_W; std::cerr << "screen->h: " << SCREEN_H; they will surely print 640 and 480, since you are just outputting the definitions... Instead of SCREEN_W and SCREEN_H use screen->w and screen->h, respectively. These in the end of the st_video_setup_gl(), that it. Thanks, Ricardo Em Quinta, 6 de Maio de 2004 21:04, o Keir Lawson escreveu: > On Thu, 2004-05-06 at 12:44 +0100, Ricardo Cruz wrote: > > Could you just add these two lines to the final of the > > st_video_setup_gl() func in setup.cpp : > > > > std::cerr << "screen->w: " << screen->w << endl; > > std::cerr << "screen->h: " << screen->h << endl; > > > > And send the output. > > well that line made it fail to compile (didnt like the endls, something > about them being undefined or something), i removed the ,, endl bit and > it compiled but nothing extra was outputted, however std::cerr << > "screen->h/w: " << SCREEN_H/W; gave me the following extra output: > screen->w: 640screen->h: 480 > > Keir Lawson > > > -- It's amazing how nice people are to you when they know you're going away. -- Michael Arlen |
From: Keir L. <ke...@th...> - 2004-05-07 17:40:54
|
On Thu, 2004-05-06 at 22:38 +0100, Ricardo Cruz wrote: > Oh, right. You just needed to replace endl by std::endl, I am used to put > 'using std::endl;' in the beginning of my code... > > Anyway, if you have used: > std::cerr << "screen->w: " << SCREEN_W; > std::cerr << "screen->h: " << SCREEN_H; > > they will surely print 640 and 480, since you are just outputting the > definitions... Instead of SCREEN_W and SCREEN_H use screen->w and screen->h, > respectively. These in the end of the st_video_setup_gl(), that it. the following lines i put right at then end of that function: std::cerr << "SCREEN_W: " << screen->w << std::endl; std::cerr << "SCREEN_H: " << screen->h << std::endl; the extra output is the same: SCREEN_W: 640 SCREEN_H: 480 Keir Lawson |
From: Ricardo C. <ri...@ae...> - 2004-05-07 22:19:47
|
Bad news is that we are unable to fix that bug... Good news is that it isn't our fault anyway ;) I will update my drivers (to the 5xxx version), as soon as I install a new version of Mandrake, and then I will check if it is driver's fault or not. Anyway, thanks for your help. Ricardo Cruz Em Sexta, 7 de Maio de 2004 18:40, o Keir Lawson escreveu: > On Thu, 2004-05-06 at 22:38 +0100, Ricardo Cruz wrote: > > Oh, right. You just needed to replace endl by std::endl, I am used to > > put 'using std::endl;' in the beginning of my code... > > > > Anyway, if you have used: > > std::cerr << "screen->w: " << SCREEN_W; > > std::cerr << "screen->h: " << SCREEN_H; > > > > they will surely print 640 and 480, since you are just outputting the > > definitions... Instead of SCREEN_W and SCREEN_H use screen->w and > > screen->h, respectively. These in the end of the st_video_setup_gl(), > > that it. > > the following lines i put right at then end of that function: > > std::cerr << "SCREEN_W: " << screen->w << std::endl; > std::cerr << "SCREEN_H: " << screen->h << std::endl; > > the extra output is the same: > > > SCREEN_W: 640 > SCREEN_H: 480 > > Keir Lawson > > -- Everything is worth precisely as much as a belch, the difference being that a belch is more satisfying. -- Ingmar Bergman |