Okay, I'm like, 3 lines of code away from making my engine come full circle, and actually getting an image result!
The problem is when I try to call my draw function, i get no picture!
Here is an example of what my Scene_Objects vector would hold
Code:
#ifndef OBJECT_H
#define OBJECT_H
#include "MS3D.h"
#include "ObjectFactory.h"
#include "ResourceManager.h"
enum OBJECTS
{
SHIP_OBJECT
};
class Object
{
public:
virtual ~Object() {}
float locx, locy, locz;
bool MarkedForDeletion;
virtual MS3DModel *GetRenderInformation() = 0;
virtual void GetPhysicsInformation() = 0;
virtual void GetSoundInformation() = 0;
virtual void Update() = 0;
};
class Ship : public Object
{
public:
Ship(float x, float y, float z)
{
x = locx;
y = locy;
z = locz;
}
virtual MS3DModel *GetRenderInformation()
{
return Models.Model1;
}
virtual void GetPhysicsInformation()
{
}
virtual void GetSoundInformation()
{
}
virtual void Update()
{
}
protected:
// Cross specific functions go here
};
#endif
And here is how I use GetModelInformation
Code:
void GLRenderer::DrawSceneObjects()
{
MS3DModel * Obj;
for (int i = 0; i<Scene_Objects.size(); i++)
{
Scene_Objects[i]->GetRenderInformation();
Obj = Scene_Objects[i]->GetRenderInformation();
Obj->DrawMS3DModels();
}
}
Now, It is probably where I make the conversion from a Models.Model1 to an Obj, or it could be that my container actually has nothing in it (which I'm pretty sure is NOT the case), or it could be that Models.Model1 doesn't actually point to a model, why would this be? I dunno...
If this helps, this is exactly wtf models is...
Code:
class ModelResources
{
public:
MS3DModel *Model1;
};
extern ModelResources Models;
As you can see, (REMEMBER THIS ISN'T PERMANENT!), its just a class holding a model pointer, ultimately I'll have a model pointer resource manager, but not yet. :d