Original Post
Hi out there.
well as you imagine, i have some problems with pointers.
i uploaded my whole code (MVC6) at:
http://www33.brinkster.com/warsim/warsim.ace
well its not quite well structured, because its experemental.
the important parts are the Object.h & cpp with all derivates and world.h & cpp.
here is my problem:
i am trying to build an engine where any dynamic part is treated the same way. so it doesnt really matter if you have a texture or a mesh or a ki-unit. everything is stored in a linked list, that starts at world.Base. every class has an own Object-Type, which is returned by the Type() funcion. and every object is referneced with a GUID (global unique id).
at the current state there are the following object types:
cBaseObject (Object.h)
---cVisObject (VisObject.h)
------cMeshObject (VisObject.h)
---cBaseTexture (Texture.h)
---cBaseMaterial (Material.h)
the critical part is in
VisObject.cpp -void cMeshObject::Render3D()
void cMeshObject::Render3D()
{
if (MeshID==0)
return;
glPushMatrix();
glTranslatef(m_vPos.x,m_vPos.y,m_vPos.z);
glScalef(0.1f,0.1f,0.1f);
cBaseMesh *mesh = (cBaseMesh*) world.Get(MeshID);
mesh->Render3D();
glPopMatrix();
}
all what this function is meant to do, is to render a mesh, BUT
if i debug the mesh->Render3D function (hit f11), the program jumps into
Material.h - void cBaseMaterial::Activate()
what''s wrong???
(sorry for my poor english, hope it doesn''t offend anyone
)