Maksasj / bebone

☠️ game development framework/engine aimed for flexible and highly customizable game development
MIT License
7 stars 0 forks source link

Removed singleton usage from Input module #116

Closed Soskar1 closed 1 week ago

Soskar1 commented 1 week ago

Singleton usage from Input module successfully removed. It changed to dependency injection pattern, which is more reliable.

But these changes leads to the further problems in our code. Now window fully controls the input and don't really like it. From my point of view, the window has a lot of functionality, and registering input is not the responsibility of this class.

I think we need to create another class (for example, Application class) that will create the window, input and other core related classes and store them. I will try to experiment with it in another branch.

Maksasj commented 1 week ago

Singleton usage from Input module successfully removed. It changed to dependency injection pattern, which is more reliable.

But these changes leads to the further problems in our code. Now window fully controls the input and don't really like it. From my point of view, the window has a lot of functionality, and registering input is not the responsibility of this class.

I think we need to create another class (for example, Application class) that will create the window, input and other core related classes and store them. I will try to experiment with it in another branch.

Yea I see. I have been thinking about this for a while, and I think you are right. We need some sort of Platform layer that will be responisble for creating windows, inputs etc, everything that is dependent on platform itself. Probably in the future then we will be adding support for other platforms, somethings may change.

But need to think how to make it look nice 🙃