1
General / Re: Proper input handler Class
« on: January 29, 2013, 04:43:52 pm »
Thanks for the hint with the key-check on Mouse-event.
And I just forgot about the fact, that there are more events possible.
The thing is, that I want/need access to the Input from arround the program (can't imagine another way of getting the input everywhere without tons of functions for handing it over). For example, a Sprite should become selected if clicked on. So within the Sprite, if clicked is true and the cursor is on him, the bool turns true. And many other things.
That's why I don't want to use the Input from within main, because I would have to deligate many things from there to somewhere else.
The overall problem I have is, that I didn't do anything that big so far. I had complex topics like artificial intelligence, opengl basics within a pong game, but the overall structure was allways quite easy in terms of programming.
Maybe you could give me an insight in how handling Input should be done, or was implemented by your programs.. @exploiter I saw you did a tile map editor - quite similar to my project. Maybe you could give me advice?
Thanks for the help so far!
And I just forgot about the fact, that there are more events possible.
The thing is, that I want/need access to the Input from arround the program (can't imagine another way of getting the input everywhere without tons of functions for handing it over). For example, a Sprite should become selected if clicked on. So within the Sprite, if clicked is true and the cursor is on him, the bool turns true. And many other things.
That's why I don't want to use the Input from within main, because I would have to deligate many things from there to somewhere else.
The overall problem I have is, that I didn't do anything that big so far. I had complex topics like artificial intelligence, opengl basics within a pong game, but the overall structure was allways quite easy in terms of programming.
Maybe you could give me an insight in how handling Input should be done, or was implemented by your programs.. @exploiter I saw you did a tile map editor - quite similar to my project. Maybe you could give me advice?
Thanks for the help so far!