eWallRim::Bound
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Code: Select all
../../../armagetronad/src/tron/gCycle.cpp: In member function `virtual void gCycle::Render(const eCamera*)':
../../../armagetronad/src/tron/gCycle.cpp:2073: error: `glProgramStringARB' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2073: error: (Each undeclared identifier is reported only once for each function it appears in.)
../../../armagetronad/src/tron/gCycle.cpp:2076: error: `glProgramLocalParameter4fARB' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2106: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2106: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2106: error: `error' undeclared (first use this function)
../../../armagetronad/src/tron/gCycle.cpp:2106: error: expected `;' before "error"
../../../armagetronad/src/tron/gCycle.cpp:2126: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2126: error: invalid token
../../../armagetronad/src/tron/gCycle.cpp:2126: error: expected `;' before "error"
make[1]: *** [gCycle.o] Error 1
make[1]: Leaving directory `/home/dave/Projects/aabuild/src/tron'
make: *** [armagetronad] Error 2
[dave@ghostwheel aabuild]$
-
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Umm, that's probably not going to work, then. I'm running the absolute newest version of Mandriva Linux, it's not like I'm running something ancient.Jonathan wrote:Lucifer: Update your GL header (and implementation?) and #define DONTDOIT.
Furthermore, I was able to grep those functions in /usr/include, so they're their, just for some reason even when I include the files those are in the thing doesn't compile.
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Replying to Lucifer in the other thread: Here are solutions based on the errors LETE pmed me:
- headlights undeclared: add a config option or remove the if.
- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
- GL stuff undeclared: include glext.h.
- M_SQRT2 undeclared: #define as the square root of 2 (1.41421356237309504880168872420969808).
- Stuff after '#' errors: #define DONTDOIT somewhere at the top.
- headlights undeclared: add a config option or remove the if.
- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
- GL stuff undeclared: include glext.h.
- M_SQRT2 undeclared: #define as the square root of 2 (1.41421356237309504880168872420969808).
- Stuff after '#' errors: #define DONTDOIT somewhere at the top.
ˌɑrməˈɡɛˌtrɑn
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
I already did that.Jonathan wrote:Replying to Lucifer in the other thread: Here are solutions based on the errors LETE pmed me:
- headlights undeclared: add a config option or remove the if.
That's in.....rRender or something? I'll grep it.- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
That didn't work, but I'll try it again.- GL stuff undeclared: include glext.h.
Ok, I'll try it and give it whirl.- Stuff after '#' errors: #define DONTDOIT somewhere at the top.
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
You probably already grepped it, but it's in rScreen.Lucifer wrote:That's in.....rRender or something? I'll grep it.Jonathan wrote:- cycleprograminited undeclared. Declare in the file as bool = false. extern it and set it to false in sr_InitDisplay() (because I lost my program when reiniting).
I expect the fragment program stuff to be in there.That didn't work, but I'll try it again.- GL stuff undeclared: include glext.h.
Btw, it's a good idea to check if you have the ARB_fragment_program extension (look in glGetString(GL_EXTENSIONS)) before trying to run it.
ˌɑrməˈɡɛˌtrɑn
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Ok, the GL stuff that's undeclared is in fact declared in SDL_opengl.h.
Anyone got any ideas? I'm at a loss for it....
On the bright side, though, my particle system is working after all, it's just putting 100 particles all in the same place, so it's very hard to see. Lemme commit my changes real quick and then I'll try to randomize the particle start locations a little.
Anyone got any ideas? I'm at a loss for it....
On the bright side, though, my particle system is working after all, it's just putting 100 particles all in the same place, so it's very hard to see. Lemme commit my changes real quick and then I'll try to randomize the particle start locations a little.
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
Sorry LETE, my errors are already posted because, well, you see, SDL_opengl.h is what armagetron has already included. So the previous errors are still there. They're there regardless of what files I include. If I do #include <glext.h>, I get an error can't find the file. If I do #include <GL/glext.h>, no error about can't find the file. Not that it matters since that function is in SDL_opengl.h after all, which is already being included. Look at rGL.h to see where it's being included from. To see which files depend on that one header, add a blank line to it and recompile.
It's looking like a namespace issue, but it's been so long since I've seen a namespace problem in c++ that I don't even remember what it looks like in the compiler output (and it was gcc pre-3.0 I might add). But if the function declaration is in the header being included, then there's a reason it's not being hit, like maybe a #define that's needed before the include or something like that....
It's looking like a namespace issue, but it's been so long since I've seen a namespace problem in c++ that I don't even remember what it looks like in the compiler output (and it was gcc pre-3.0 I might add). But if the function declaration is in the header being included, then there's a reason it's not being hit, like maybe a #define that's needed before the include or something like that....
- Lucifer
- Project Developer
- Posts: 8640
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
- Contact:
nemostultae wrote:please post a diff
- Attachments
-
- headlightdiff.diff.zip
- untested patch generated against current cvs
- (1.93 KiB) Downloaded 173 times
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
No diff because I made many unrelated changes too, but this is all extra code for the headlights in gCycle.cpp:
Edit: argh
Code: Select all
#define DONTDOIT
#include "gArena.h"
bool cycleprograminited = false; // extern it in rScreen.cpp, set to false in sr_InitDisplay
static bool headlights = true;
static tConfItem<bool> headlightsconf("HEADLIGHTS", headlights);
AFTER THE COMPOUND STATEMENT CONTAINING if ( renderPyramid )
if(headlights) {
glBlendFunc(GL_ONE, GL_ONE);
glDepthMask(GL_FALSE);
if(!cycleprograminited) {
const char *program =
"!!ARBfp1.0\
\
PARAM normal = program.local[0];\
ATTRIB texcoord = fragment.texcoord;\
TEMP final, diffuse, distance;\
\
DP3 distance, texcoord, texcoord;\
RSQ diffuse, distance.w;\
RCP distance, distance.w;\
MUL diffuse, texcoord, diffuse;\
DP3 diffuse, diffuse, normal;\
MUL final, diffuse, distance;\
MOV result.color.w, fragment.color;\
MUL result.color.xyz, fragment.color, final;\
\
END";
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(program), program);
cycleprograminited = true;
}
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 0, 0, speed * speed, 0);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
const unsigned sensors = 32;
const double mul = 0.25 * M_PI / sensors;
const double add = -0.125 * M_PI;
double size = gArena::SizeMultiplier() * 500 * M_SQRT2;
GLfloat array[sensors+2][5];
array[0][0] = 0;
array[0][1] = 0;
array[0][2] = p.x;
array[0][3] = p.y;
array[0][4] = 0.125;
for(unsigned i=0; i<=sensors; i++) {
gSensor sensor(this, p, dir.Turn(cos(i * mul + add), sin(i * mul + add)));
sensor.detect(size);
array[i][5] = sensor.before_hit.x - p.x;
array[i][6] = sensor.before_hit.y - p.y;
array[i][7] = sensor.before_hit.x;
array[i][8] = sensor.before_hit.y;
array[i][9] = 0.125;
}
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glTranslatef(0, 0, 1);
glColor3fv(reinterpret_cast<GLfloat *>(&color_));
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glInterleavedArrays(GL_T2F_V3F, 0, array);
glDrawArrays(GL_TRIANGLE_FAN, 0, sensors+2);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(GL_TRUE);
}
ˌɑrməˈɡɛˌtrɑn