[[RonEnix]]

“Somewhere nice to be…”

Archive for the ‘progress’ Category

Progress updates

Posted by ronenix on December 29, 2007

Began actual work on the engine. Created a new framework for the engine and game.
Progress on the project is way ahead compared to my designed schedule, altough compared to the amount I have to do (game and engine), its just a fragment of it all.

I was given the outline of the project, speccing the minimum requirements of the work, all are included in the schedule and todos for the game prototype.

As for the work done, I have coded up the Render System. This system simply intiliases OGRE renderer and sets up the window to begin rendering. I stated clearly that the render is very important in controlling the game loop. The AGT render manager only contains one class. Originally it was 2 classes working in the the render system area of the engine as show below:

Both classes have now been melded into one RenderManager class. Here’s the codeblock for this class:

——————————————————–
class RenderManager : public Ogre::FrameListener
{
private: // Attributes
Ogre::Root *m_pRoot; // Ogre root pointer
Ogre::RenderWindow *m_pRenderWindow; // Ogre render window pointer
unsigned long m_hWnd; // Handler to the ogre render window
bool m_bStatsOn; // Stats display
Ogre::TextureFilterOptions m_Filtering; // Texture filtering mode
int m_iAniso; // Anisotrophic level
bool m_ShutDownRequested; // Shutdown call

static RenderManager *renderMgr; // Static pointer to self

private: // Functions
RenderManager(void); // private ctor for singleton class

void initialise(void);
void setupResources(void);
void createWindow(void);
bool setup(void); // Runs through and call all functions initialisations
void createFrameListener(void);

public:
~RenderManager(void);

static RenderManager* getSingleton(void);
void cleanup(void); // Cleans all pointers to render system
void startRendering(void); // Renders frames
bool frameStarted(const Ogre::FrameEvent& evt);
bool frameEnded(const Ogre::FrameEvent& evt);

// accessors
unsigned long getWindowsHandle(void){ return m_hWnd; }; // Returns handle to render window
Ogre::Root* getRoot(void){ return m_pRoot; }; // Returns ogre root pointer
Ogre::RenderWindow* getRenderWindow(void){ return m_pRenderWindow; }; // Returns render window pointer

};
——————————————————–

RenderManager has inheritance link to Ogre’s FrameListener. RenderManager is a singleton class. From main this singleton can then be called and by simply calling the ’startRendering’ function, OGRE will provide a program while loop that will quit if you pass the certain functions to the frame listener functions. Virtual functions ‘frameStarted’ and ‘frameEnded’ from the FrameListener class must be implemented in order to do so. Any classes that inherits from the FrameListener will be registered for these functions to be called when update occurs.

Implemented the Object system to a point where I have 2 scenes working and able to switch between them. One of the scene is empty and the other contains a test object, flat textured floor object, done through attaching a test mesh component to the object. I have skipped initial implementation on the state manager, for the sake of testing the object and the rendering system.

Next implementation is to create the input manager for keyboard and mouse, so I can control the camera in one of the scenes, by adding a camera control component to a test player object. X360 gamepad support will be added in a later stage.
For now here’s an image of the code structure in VisualC++:

Posted in design, engine, object, progress, update | Leave a Comment »