removing GLFW support

This commit is contained in:
2024-05-25 16:47:28 +02:00
parent afee09d1ea
commit 81387ec53d
17 changed files with 153 additions and 260 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */
/* Updated: 2024/04/21 20:39:33 by maldavid ### ########.fr */
/* Updated: 2024/05/25 15:26:36 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,7 +15,6 @@
#include <Core/Graphics.h>
#include <Platform/Inputs.h>
#include <Core/DriverLoader.h>
#include <Core/ImagesRegistry.h>
#include <Core/Fps.h>
@@ -61,7 +60,6 @@ namespace mlx
private:
FpsManager m_fps;
Input m_in;
DriverLoader m_driver_loader;
ImageRegistry m_image_registry;
std::vector<std::unique_ptr<GraphicsSupport>> m_graphics;
std::function<int(void*)> f_loop_hook;
@@ -69,6 +67,6 @@ namespace mlx
};
}
#include <core/application.inl>
#include <Core/Application.inl>
#endif // __MLX_APPLICATION__

View File

@@ -1,30 +0,0 @@
/* **************************************************************************** */
/* */
/* ::: :::::::: */
/* DriverLoader.inl :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/03 14:55:01 by maldavid #+# #+# */
/* Updated: 2024/04/03 14:55:01 by maldavid ### ########.fr */
/* */
/* **************************************************************************** */
#pragma once
#include <Core/DriverLoader.h>
namespace mlx
{
template <typename T>
bool DriverLoader::LoadDriver()
{
m_instances.emplace_back(new T)->InitDriver();
}
void DriverLoader::ShutdownAllDrivers()
{
for(auto& driver : m_instances)
driver->ShutdownDriver();
m_instances.clear();
}
}

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */
/* Updated: 2024/04/23 14:02:48 by maldavid ### ########.fr */
/* Updated: 2024/05/25 01:00:10 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -70,6 +70,6 @@ namespace mlx
};
}
#include <core/graphics.inl>
#include <Core/Graphics.inl>
#endif

View File

@@ -1,39 +1,41 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* DriverLoader.h :+: :+: :+: */
/* SDLManager.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/02 16:56:10 by maldavid #+# #+# */
/* Updated: 2024/04/03 15:02:44 by maldavid ### ########.fr */
/* Created: 2024/05/25 15:28:59 by maldavid #+# #+# */
/* Updated: 2024/05/25 16:11:50 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef __MLX_CORE_DRIVER_LOADER__
#define __MLX_CORE_DRIVER_LOADER__
#ifndef __MLX_SDL_MANAGER__
#define __MLX_SDL_MANAGER__
#include <Drivers/DriverInstance.h>
#include <Utils/Singleton.h>
namespace mlx
{
class DriverLoader
class SDLManager : public Singleton<SDLManager>
{
friend class Singleton<SDLManager>;
public:
DriverLoader() = default;
void Init() noexcept;
void Shutdown() noexcept;
template <typename T>
inline bool LoadDriver();
inline void ShutdownAllDrivers();
~DriverLoader() = default;
void* CreateWindow(const std::string& title, std::size_t w, std::size_t h);
void DestroyWindow(void* window) noexcept;
private:
std::vector<std::unique_ptr<DriverInstance> > m_instances;
SDLManager() = default;
~SDLManager() = default;
private:
std::unordered_set<void*> m_windows_registry;
bool m_drop_sdl_responsability = false;
};
}
#include <Core/DriverLoader.inl>
#endif