Original Post
Hello everyone,
I'm studying C++ for 1 year now and we need to make a game for school in a few months. We received a game engine for our game from school but I don't like that engine so I want to write my own engine.
Last year I made many projects how to make windows, how to paint lines, how to draw bitmaps, without an engine. And now, I think, I got the basics of everything for writing a game engine.
So I've started with writing and I got some questions about it,
I let the user write their " int WINAPI WinMain(...) {...} " and they include my engine to that project. So my engine got a method Startup and Shutdown. Is this smart to do?
To let the user use those 2 methods he need to ask the GameEngine instance first. I made my GameEngine object on the stack so I don't need to create/delete it. So in 1 method I send it to the user. ( GetInstance(); )
That method is static so the user can use all my other public methods from the GameEngine. Still I don't know if this is a good way to write an engine.. I could use some opinions / better options.
And last, I don't know what to use. Shall I make a Painter class that will paint all my stuff ( text, bitmaps, etc ), or shall I make all my objects independent and make it able that they can paint their self. ( Image1.Paint(); )
Have any of you got some experience with writing a game engine? So yes, am I going in the right direction?
Kind regards,
Jonathan
I'm studying C++ for 1 year now and we need to make a game for school in a few months. We received a game engine for our game from school but I don't like that engine so I want to write my own engine.
Last year I made many projects how to make windows, how to paint lines, how to draw bitmaps, without an engine. And now, I think, I got the basics of everything for writing a game engine.
So I've started with writing and I got some questions about it,
I let the user write their " int WINAPI WinMain(...) {...} " and they include my engine to that project. So my engine got a method Startup and Shutdown. Is this smart to do?
To let the user use those 2 methods he need to ask the GameEngine instance first. I made my GameEngine object on the stack so I don't need to create/delete it. So in 1 method I send it to the user. ( GetInstance(); )
That method is static so the user can use all my other public methods from the GameEngine. Still I don't know if this is a good way to write an engine.. I could use some opinions / better options.
And last, I don't know what to use. Shall I make a Painter class that will paint all my stuff ( text, bitmaps, etc ), or shall I make all my objects independent and make it able that they can paint their self. ( Image1.Paint(); )
Have any of you got some experience with writing a game engine? So yes, am I going in the right direction?
Kind regards,
Jonathan