working on event system

This commit is contained in:
kbz_8
2023-04-04 12:40:47 +02:00
parent e444856964
commit d360c8fb6a
11 changed files with 122 additions and 57 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:30:19 by maldavid #+# #+# */
/* Updated: 2023/04/01 16:46:13 by maldavid ### ########.fr */
/* Updated: 2023/04/03 12:40:10 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,6 +25,9 @@ namespace mlx
{
_xRel = 0;
_yRel = 0;
if(!_auto_repeat)
std::memset(_keys.data(), 0, SDL_NUM_SCANCODES);
while(SDL_PollEvent(&_event))
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */
/* Updated: 2022/12/18 23:09:41 by maldavid ### ########.fr */
/* Updated: 2023/04/03 14:19:11 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -43,6 +43,9 @@ namespace mlx
inline bool is_running() const noexcept { return !_end; }
inline constexpr void finish() noexcept { _end = true; }
inline constexpr void enableAutoRepeat() noexcept { _auto_repeat = true; }
inline constexpr void disableAutoRepeat() noexcept { _auto_repeat = false; }
~Input() = default;
private:
@@ -56,5 +59,6 @@ namespace mlx
int _yRel = 0;
bool _end = false;
bool _auto_repeat = true;
};
}