fixing compatibility, workign on renderer

This commit is contained in:
Kbz-8
2022-12-18 04:04:10 +01:00
parent f52c4e51c9
commit 4a67aab716
48 changed files with 6535 additions and 75 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: 2022/10/05 19:24:30 by maldavid ### ########.fr */
/* Updated: 2022/12/18 01:13:32 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,7 +15,7 @@
namespace mlx
{
Input::Input(const std::vector<std::shared_ptr<Window>>& wins) : _wins(wins)
Input::Input(const std::vector<std::shared_ptr<MLX_Window>>& wins) : _wins(wins)
{
std::memset(_keys.data(), 0, SDL_NUM_SCANCODES);
std::memset(_mouse.data(), 0, 8);

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/10/05 19:53:18 by maldavid ### ########.fr */
/* Updated: 2022/12/18 01:13:19 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,7 +25,7 @@ namespace mlx
class Input
{
public:
Input(const std::vector<std::shared_ptr<Window>>& wins);
Input(const std::vector<std::shared_ptr<MLX_Window>>& wins);
void update();
@@ -49,7 +49,7 @@ namespace mlx
SDL_Event _event;
std::array<uint8_t, SDL_NUM_SCANCODES> _keys;
std::array<uint8_t, 8> _mouse;
std::vector<std::shared_ptr<Window>> _wins;
std::vector<std::shared_ptr<MLX_Window>> _wins;
int _x = 0;
int _y = 0;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:36:44 by maldavid #+# #+# */
/* Updated: 2022/10/05 18:39:11 by maldavid ### ########.fr */
/* Updated: 2022/12/18 01:12:05 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,14 +15,14 @@
namespace mlx
{
Window::Window(std::size_t w, std::size_t h, std::string title, int id) : _id(id)
MLX_Window::MLX_Window(std::size_t w, std::size_t h, std::string title, int id) : _id(id)
{
_win = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, w, h, /*SDL_WINDOW_VULKAN |*/ SDL_WINDOW_SHOWN);
if(!_win)
core::error::report(e_kind::fatal_error, std::string("Unable to open a new window, ") + SDL_GetError());
}
Window::~Window()
MLX_Window::~MLX_Window()
{
if(_win)
SDL_DestroyWindow(_win);

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:53:12 by maldavid #+# #+# */
/* Updated: 2022/10/05 19:10:35 by maldavid ### ########.fr */
/* Updated: 2022/12/18 03:41:53 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,14 +18,17 @@
namespace mlx
{
class Window
class MLX_Window
{
public:
Window(std::size_t w, std::size_t h, std::string title, int id);
MLX_Window(std::size_t w, std::size_t h, std::string title, int id);
inline int& get_id() noexcept { return _id; }
inline SDL_Window* getNativeWindow() const noexcept { return _win; }
void pixel_put(int x, int y, int color) {}
~Window();
~MLX_Window();
private:
SDL_Window* _win = nullptr;