From 826428bc1a60d0117757202b3065d29f93ac93ee Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Fri, 18 Jan 2019 15:53:34 +0100 Subject: [PATCH] engine: Remove abandoned attempt at modernizing the API --- Engine/Engine.cpp | 43 --------------------------------------- Engine/Engine.h | 30 --------------------------- Engine/GraphicsDriver.cpp | 1 - Engine/GraphicsDriver.h | 7 ------- Engine/Public.h | 5 ----- Engine/Renderer.h | 8 -------- 6 files changed, 94 deletions(-) delete mode 100644 Engine/Engine.cpp delete mode 100644 Engine/Engine.h delete mode 100644 Engine/GraphicsDriver.cpp delete mode 100644 Engine/GraphicsDriver.h delete mode 100644 Engine/Public.h delete mode 100644 Engine/Renderer.h diff --git a/Engine/Engine.cpp b/Engine/Engine.cpp deleted file mode 100644 index 5a7206d..0000000 --- a/Engine/Engine.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "Engine.h" - -Engine Engine::GetInstance() { - return Instance; -} - -Engine::Engine() { - -} - -Engine::~Engine() { - // Unload all GraphicsDrivers - for (auto iter = m_GraphicsDrivers.begin(); iter != m_GraphicsDrivers.end(); iter++) { - UnloadGraphicsDriver(*iter); - } -} - -typedef GraphicsDriver*(__stdcall *GraphicsDriverInstance_t)(); - -GraphicsDriver* Engine::LoadGraphicsDriver(std::string libraryPath) { - HINSTANCE lib = LoadLibrary(libraryPath.c_str()); - if (lib != NULL) { - FARPROC fnGraphicsDriverInstance = GetProcAddress(lib, "GraphicsDriverInstance"); - if (fnGraphicsDriverInstance != NULL) { - GraphicsDriver* graphicsDriver = ((GraphicsDriverInstance_t)fnGraphicsDriverInstance)(); - - // Insert into list. - m_GraphicsDrivers.emplace_back(graphicsDriver); - m_GraphicsDrivers_MapToLibrary[graphicsDriver] = lib; - - return graphicsDriver; - } - FreeLibrary(lib); - } - - // An error occured, handle it somehow here. - MessageBox(0, "Not Yet Implemented", "Not Yet Implemented", 0); - return nullptr; -} - -void Engine::UnloadGraphicsDriver(GraphicsDriver* graphicsDriver) { - -} diff --git a/Engine/Engine.h b/Engine/Engine.h deleted file mode 100644 index 8f05701..0000000 --- a/Engine/Engine.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "GraphicsDriver.h" - -class Engine { -#pragma region Singleton -private: - const static Engine Instance; -public: - Engine GetInstance(); -#pragma endregion - -public: - Engine(); - ~Engine(); - - GraphicsDriver* LoadGraphicsDriver(std::string libraryPath); - void UnloadGraphicsDriver(GraphicsDriver*); - - - -private: - std::list m_GraphicsDrivers; - std::map m_GraphicsDrivers_MapToLibrary; -}; \ No newline at end of file diff --git a/Engine/GraphicsDriver.cpp b/Engine/GraphicsDriver.cpp deleted file mode 100644 index 93ec916..0000000 --- a/Engine/GraphicsDriver.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "GraphicsDriver.h" \ No newline at end of file diff --git a/Engine/GraphicsDriver.h b/Engine/GraphicsDriver.h deleted file mode 100644 index 7e0a8de..0000000 --- a/Engine/GraphicsDriver.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "Renderer.h" - -class GraphicsDriver { -public: -}; \ No newline at end of file diff --git a/Engine/Public.h b/Engine/Public.h deleted file mode 100644 index 32ff104..0000000 --- a/Engine/Public.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "Engine.h" -#include "GraphicsDriver.h" -#include "Renderer.h" diff --git a/Engine/Renderer.h b/Engine/Renderer.h deleted file mode 100644 index 8c7c814..0000000 --- a/Engine/Renderer.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -class Renderer { -public: - -private: - -}; \ No newline at end of file