Separating my engine and game code, should the game or the engine contain main()?

Started by
10 comments, last by schen2000 7 years ago

Very helpful answers guys, I think I'm going to make my exe be a launcher and have my game and engine be external.

Thanks a ton.

Advertisement

So I'm writing my own engine for fun, and I want to have several games using this engine but I'm not sure where the program initialization code should live.

In my simple OpenGL VR engine, I have different approach then normal.

( https://github.com/simviu/IcEng ).

It's not game engine, but simple static model graphics engine support VR.

The Engine is built in static lib. There is class call IcApp wrap everything inside.

The Application specific logic derive IcApp and override it's onInit()/onUpdate() member functions.

There are IcWindow and IcScene class, works similar way.

Thus the main() simply launch the MyApp class, which is derived from IcApp.

This method helps to implement cross platform consistent code , even on iOS/Android.

S. Chen

Hope that is helpful.

This topic is closed to new replies.

Advertisement