Original Post
Hello :) I've recently started using Java, after a switch from C++ (got bored and frustrated with poor IDE and complicated language). Anyway, when doing (more like trying to) apply OOP to my projects, I often find myself confused. To put it into gamedev perspective:
Let's say I'm having a Texture object, which can be bound to the current state/sampler/whatever. What approach is preferable, renderer.bindTexture(tex) or tex.bindTexture()? When should you use one approach and when would the second be better?
My assumption is that unless you can use friend classes, second approach is better because you have full access to the class. On the other hand, clumping all device state in renderer could be a better way to group things.
Let's say I'm having a Texture object, which can be bound to the current state/sampler/whatever. What approach is preferable, renderer.bindTexture(tex) or tex.bindTexture()? When should you use one approach and when would the second be better?
My assumption is that unless you can use friend classes, second approach is better because you have full access to the class. On the other hand, clumping all device state in renderer could be a better way to group things.