engine: Remove abandoned attempt at modernizing the API

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-01-18 15:53:34 +01:00
parent 3bc04e1602
commit 826428bc1a
6 changed files with 0 additions and 94 deletions
-43
View File
@@ -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) {
}
-30
View File
@@ -1,30 +0,0 @@
#pragma once
#include <string>
#include <list>
#include <map>
#include <windows.h>
#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<GraphicsDriver*> m_GraphicsDrivers;
std::map<GraphicsDriver*, HINSTANCE> m_GraphicsDrivers_MapToLibrary;
};
-1
View File
@@ -1 +0,0 @@
#include "GraphicsDriver.h"
-7
View File
@@ -1,7 +0,0 @@
#pragma once
#include "Renderer.h"
class GraphicsDriver {
public:
};
-5
View File
@@ -1,5 +0,0 @@
#pragma once
#include "Engine.h"
#include "GraphicsDriver.h"
#include "Renderer.h"
-8
View File
@@ -1,8 +0,0 @@
#pragma once
class Renderer {
public:
private:
};