engine: Remove abandoned attempt at modernizing the API
This commit is contained in:
@@ -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) {
|
||||
|
||||
}
|
||||
@@ -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 +0,0 @@
|
||||
#include "GraphicsDriver.h"
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Renderer.h"
|
||||
|
||||
class GraphicsDriver {
|
||||
public:
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Engine.h"
|
||||
#include "GraphicsDriver.h"
|
||||
#include "Renderer.h"
|
||||
@@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class Renderer {
|
||||
public:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user