adding imputs system

This commit is contained in:
Kbz-8
2022-10-05 17:08:36 +02:00
commit 5df9b4d39f
15 changed files with 825 additions and 0 deletions

30
src/platform/window.cpp git.filemode.normal_file
View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* window.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:36:44 by maldavid #+# #+# */
/* Updated: 2022/10/04 22:09:27 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include "window.h"
#include <core/errors.h>
namespace mlx
{
Window::Window(std::size_t w, std::size_t h, std::string title)
{
_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()
{
if(_win)
SDL_DestroyWindow(_win);
}
}