Ever since i started game development ive always tried to split up the logic from the rendering as best i can. However im not too familiar with Java so im not sure entirely how to do it correctly within Java while making the most of OO styles etc…
Ive currently got an “Engine.Objects” package that contains all my objects (logic) and i have a “Engine.Renderer” package that should be used to render everything. Now im not sure which is the best way to do this…
I can send the GL object from the renderer to the given object if needed so it can render itself, but then the Objects are dependant on it being GL and being that specific renderer class.
The other option is that i give the renderer a set of points to draw from the objects, which sounds alot more appealing, but this way the renderer has to be reliant on the objects to know how the objects are formed and stuff.
This sort of stuff has always bugged me, even back in C++ when i was trying to design a decent framework, i got round it there by prototyping the given classes wherever needed rather than directly including them then when they were passed over they knew what to do with them.
Can anyone give any advice on whats the best way to do this sort of thing?