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

Decoupling view and world logic. #70

Open
TristanTrim opened this issue Apr 25, 2016 · 2 comments
Open

Decoupling view and world logic. #70

TristanTrim opened this issue Apr 25, 2016 · 2 comments

Comments

@TristanTrim
Copy link
Contributor

TristanTrim commented Apr 25, 2016

I'm decoupling the view (drawing to canvas) from the world logic, but I'm finding that I need to either hand a 'world reference' to view, and a 'view reference' to world in main OR call functions on both of them from window, and hand data back and forth.

I'm after clean modularity, and down the line the possibility of running the world without a view. For that I think functions called by window would be better. But they both seem kinda kludgy.

Are there any pros and cons I'm missing?

@mrpudn
Copy link
Contributor

mrpudn commented Apr 25, 2016

When I split up the original main.py, I tried to move all of the opengl stuff into World, but I noticed some weird rendering errors when I did that. I'd say World shouldn't be much more than a glorified dict. Window can handle all of the opengl stuff and other rendering activities until we can break it down.

Thoughts?

@TristanTrim
Copy link
Contributor Author

TristanTrim commented Apr 25, 2016

Yeah, I noticed there is opengl stuff in both window and world. Right now window is handling the update loop, user input, and some rendering stuff. I'd like to have window basically act as a dispatcher: calling update functions, and handling input from the user. It would call to update the view, but not handle all of the view logic itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants