Archived

This topic is now archived and is closed to further replies.

skillfreak

argH!.. engine dll confusion

Recommended Posts

skillfreak    160
I am making a game engine ( arn''t we all ) and i am going to put the engine in an engine.dll. My reason for this is so i can create a game which would interface this engine as well as a wysiwyg map editor ( wc3 like ) without rewriting any code. My problem is the structure of the engine. Currently it is setup something like class engine : public application { graphicsDevice *gd; inputDev *id; run(); } // please excuse my pseudo code ok.. i''ve had an epiphany. Maybe i should create an interface class ( much like the article on this site describes ) .. well here. lemme write some code again class Engine { // all functions that would be called from engine virtual LoadModel( ~~~ ); virtual RenderScene( ~~~ ); virtual SetGameTime( ~~~ ); // day night cycle virtual CreateMap( width, height, baseheight ); } then the engine would simply extend this interface class. class CoreEngine : public Engine { graphics *gd; LoadModel( ~~ ) { asdfasdf }; } I think this would work. So in the mapeditor or the game, i would just be provided a slew of functions ( kinda like quake ). But in the coreengine, the code would be clean and oo. hmmm.. i''m now wondering if this is the best implementation. Feedback pls. ignore my tangent. Thanks .. andy

Share this post


Link to post
Share on other sites