sorry again, this isn’t really opengl related. i’m trying to pull together a raytracer, but i have this problem. i have a class that is a root class for a lot of other classes.
for instance in this code:
…int recurseLevel;
int row, col; // for screen extents
int numInside; // number of objects on list
GeomObj* inside[10]; // array of object pointers
Ray();.........
i get these errors and more all over:
\mesh.h(46) : error C2143: syntax error : missing ‘;’ before ‘*’
mesh.h(46) : error C2501: ‘GeomObj’ : missing storage-class or type specifiers
now obviously the GeomObj class is not getting recognized as a type specifier
this is the declaration and definition of the class:
//@@@@@@@@@@@@@@@@@@@@@ GeomObj class @@@@@@@@@@@@@@@@
class GeomObj{
public:
IntRect scrnExtnt;
Cuboid genBoxExtent,worldBoxExtent;
SphereInfo genSphereExtent,worldSphereExtent;
GeomObj * next;
GeomObj(): next(NULL){}
virtual bool hit(Ray &r, Intersection &inter);
virtual void loadStuff();
virtual void drawOpenGL();
virtual void tellMaterialsGL();
virtual void makeExtentPoints(PointCluster& clust);
virtual Point2 texturePoint(Point3 p);
virtual Color3 texture(HitInfo& h);
};
//@@@@@@@@@@@@@@@@@@@@@ GeomObj class @@@@@@@@@@@@@@@@
bool GeomObj::hit(Ray &r, Intersection &inter){return false;} //virtual
void GeomObj::loadStuff(){return;} //virtual
void GeomObj::drawOpenGL(){return;} //virtual
void GeomObj::tellMaterialsGL(){return;} //virtual
void GeomObj::makeExtentPoints(PointCluster& clust) //virtual
{cout << “in makeExtentPoints for GeomObj”;}
Point2 GeomObj::texturePoint(Point3 p){Point2 pt(0,0); return pt;}
Color3 GeomObj::texture(HitInfo& h){Color3 c(0,0,0); return c;}
ok and if i type in for instance “GeomObj::” into MSvisualC++ i get a list of all the class functions and members… all of my other classes work.
there is one line in this i don’t understand but i got it from a textbook it is:
GeomObj(): next(NULL){}
in the declaration. i can’t find info on this type of code anywhere.
but i think most likely there is a very stupid reason it is not taking. as it usually always is. sorry to be a pain. if any one would let me email the source code to them to sort it out it would be my pleasure to do so. everything is 140kb uncompressed. thank you for your time and consideration.
sincerely,
Michael