working on window manager

This commit is contained in:
Kbz-8
2022-10-05 20:37:04 +02:00
parent 5df9b4d39f
commit f52c4e51c9
10 changed files with 83 additions and 24 deletions

View File

@@ -6,13 +6,17 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */
/* Updated: 2022/10/05 16:45:55 by maldavid ### ########.fr */
/* Updated: 2022/10/05 19:53:18 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <SDL2/SDL.h>
#include <cstdint>
#include <array>
#include <memory>
#include <vector>
#include <cstdint>
#include <SDL2/SDL.h>
#include "window.h"
namespace mlx
{
@@ -21,7 +25,7 @@ namespace mlx
class Input
{
public:
Input();
Input(const std::vector<std::shared_ptr<Window>>& wins);
void update();
@@ -37,14 +41,15 @@ namespace mlx
inline int getYRel() const noexcept { return _yRel; }
inline bool is_running() const noexcept { return !_end; }
inline void finish() noexcept { _end = true; }
inline constexpr void finish() noexcept { _end = true; }
~Input() = default;
private:
SDL_Event _event;
std::array<uint8_t, SDL_NUM_SCANCODES> _keys;
std::array<uint8_t, 8> _mouse;
SDL_Event _event;
std::vector<std::shared_ptr<Window>> _wins;
int _x = 0;
int _y = 0;