Thread: Drawing Bug

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968

    Drawing Bug

    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
    Last edited by Shamino; 12-18-2005 at 08:47 PM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    Sorry for my stupidity everyone...

    Turns out I never put anything in Scene_Objects
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  3. #3
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    Resolved.
    Last edited by Shamino; 12-19-2005 at 01:33 AM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  2. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 05:09 PM
  3. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM
  4. Drawing Bug
    By Shamino in forum Game Programming
    Replies: 0
    Last Post: 12-06-2005, 10:40 PM
  5. drawing minimaps and radar screens.
    By Eber Kain in forum Game Programming
    Replies: 4
    Last Post: 03-08-2002, 11:44 AM