Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameMain / Renderer design? #286

Closed
Jon0 opened this issue Apr 19, 2015 · 2 comments
Closed

GameMain / Renderer design? #286

Jon0 opened this issue Apr 19, 2015 · 2 comments
Labels
lang: c++ Done in C++ code to-discuss Idea or suggestion that needs some discussion before implementation

Comments

@Jon0
Copy link
Member

Jon0 commented Apr 19, 2015

GameMain could be broken into several components, I think splitting into model (terrain, units), view (main opengl rendering) and controller (hud/hotkeys) might work.

This would allow all the rendering code to be split into its own system, allowing easy future extensions (3d terrain or something)
The UnitTypes currently contain graphics, it maybe be better to remove these and have the renderer map UnitTypes to graphics which would allow easier graphic modding

@TheJJ TheJJ added lang: c++ Done in C++ code to-discuss Idea or suggestion that needs some discussion before implementation labels Apr 19, 2015
@TheJJ
Copy link
Member

TheJJ commented Apr 19, 2015

Jup, that should be the way to go. Currently i'm implementing the new renderer which any object registers to. The renderer then fetches all the render instructions and orders them efficiently, then submits it to the driver (using either GL2, GL3 or Vulkan (gl2 support will be annoying..)).

The model (terrain, units) therefore just provides render instructions, they can even be implemented in some other subsystem and a pointer to them is returned to the renderer.

@TheJJ TheJJ mentioned this issue Apr 21, 2015
42 tasks
@TheJJ
Copy link
Member

TheJJ commented Apr 23, 2015

By the way, i think the current design that the "engine" is created and is then passed to some "engine-user" (in this case GameMain) is pretty good. We have to create clean engine features that can be used by a "game".

Of course all game features are implemented in the engine someday, but that way we can create engine features from the GameMain until it is empty and our structure stays clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: c++ Done in C++ code to-discuss Idea or suggestion that needs some discussion before implementation
Projects
None yet
Development

No branches or pull requests

2 participants