-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
152 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 18 additions & 16 deletions
34
runtime/Includes/Core/DriverLoader.h → runtime/Includes/Core/SDLManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
{ | ||
public: | ||
DriverLoader() = default; | ||
friend class Singleton<SDLManager>; | ||
|
||
template <typename T> | ||
inline bool LoadDriver(); | ||
public: | ||
void Init() noexcept; | ||
void Shutdown() noexcept; | ||
|
||
inline void ShutdownAllDrivers(); | ||
void* CreateWindow(const std::string& title, std::size_t w, std::size_t h); | ||
void DestroyWindow(void* window) noexcept; | ||
|
||
~DriverLoader() = default; | ||
private: | ||
SDLManager() = default; | ||
~SDLManager() = default; | ||
|
||
private: | ||
std::vector<std::unique_ptr<DriverInstance> > m_instances; | ||
std::unordered_set<void*> m_windows_registry; | ||
bool m_drop_sdl_responsability = false; | ||
}; | ||
} | ||
|
||
#include <Core/DriverLoader.inl> | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.