Right, not entirely sure what's going on with this.
I can't work out why my Object and Zone classes are unable to find the Polygon class (despite it being there above them) when the Object class is picked up fine by the Zone class.
The code;
struct Vector
{
float x,y,z;
};
class Vertex
{
Vector position,normal;
};
class Material//contains a diffuse(texture)map,a normal(bump)map, a specular map, and a sound effect for objects moving across it
{
Texture *diffuse,*normal,*specular;
};
class Polygon
{
Vertex* index_list;
size_t num_indices;
Material* material;
};
class Object
{
Polygon* polygon_list;
Object* children;
size_t num_polys,num_children;
};
class Zone
{
Object* object_list;
Polygon* polygon_list;
size_t num_objects,num_tris;
public:
void AddObject(Object*,size_t);
void RemoveObject(Object*);
};
class Level
{
Zone* zone_list;
Material* material_list;
size_t num_zones,num_materials;
public:
void LoadLevel();
};
and the errors;
level.h:28: error: ISO C++ forbids declaration of `Polygon' with no type // <-Object
level.h:28: error: expected `;' before '*' token
level.h:36: error: ISO C++ forbids declaration of `Polygon' with no type // <-Zone
level.h:36: error: expected `;' before '*' token
I've tried deleting the object files(not suprisingly didn't do anything, as this is in a header), removing and re-adding the file to the project, and resetting the computer, but I'm out of ideas. Is it just a coding problem that's glaringly obvious to others, or am I justified in being stumped?
Oh, and before I forget, Texture is defined in another header, linked in before this one.