Made multiple managers for individual pieces
Added UIManager that renders the UI inside the window
This commit is contained in:
@ -3,23 +3,18 @@
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
|
||||
#include "Engine.h"
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
|
||||
#include "graphics/Shader.h"
|
||||
#include "graphics/Window.h"
|
||||
#include "graphics/Camera.h"
|
||||
#include "graphics/Renderable.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include "MemoryManager.h"
|
||||
#include "Input/InputManager.h"
|
||||
#include "Graphics/Renderer.h"
|
||||
#include "Graphics/GUI/GUIManager.h"
|
||||
|
||||
void WARN(std::string message);
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
void WARN(std::string message);
|
@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
namespace BarinkEngine {
|
||||
|
||||
class Engine {
|
||||
public:
|
||||
static void Startup();
|
||||
static void Shutdown();
|
||||
|
||||
};
|
||||
};
|
15
BarinkEngine/Include/Graphics/GUI/GUIManager.h
Normal file
15
BarinkEngine/Include/Graphics/GUI/GUIManager.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "Graphics/Window.h"
|
||||
|
||||
|
||||
class GUIManager {
|
||||
public:
|
||||
GUIManager(BarinkWindow* window);
|
||||
~GUIManager();
|
||||
|
||||
void Render();
|
||||
|
||||
|
||||
private:
|
||||
BarinkWindow* currentwindow;
|
||||
};
|
@ -13,10 +13,6 @@
|
||||
*/
|
||||
|
||||
class Renderable {
|
||||
private:
|
||||
std::vector<BarinkEngine::Mesh> meshes;
|
||||
Renderable();
|
||||
|
||||
public:
|
||||
Buffer vertexBuffer;
|
||||
Buffer elementBuffer;
|
||||
@ -27,4 +23,7 @@ public:
|
||||
static Renderable Load();
|
||||
void Draw();
|
||||
|
||||
private:
|
||||
std::vector<BarinkEngine::Mesh> meshes;
|
||||
Renderable();
|
||||
};
|
21
BarinkEngine/Include/Graphics/Renderer.h
Normal file
21
BarinkEngine/Include/Graphics/Renderer.h
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include "Graphics/Renderable.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace BarinkEngine {
|
||||
|
||||
class Renderer {
|
||||
public:
|
||||
Renderer();
|
||||
~Renderer();
|
||||
|
||||
void Render();
|
||||
|
||||
void Submit(Renderable* model);
|
||||
|
||||
private:
|
||||
std::vector<Renderable*> models;
|
||||
|
||||
};
|
||||
}
|
18
BarinkEngine/Include/Input/InputManager.h
Normal file
18
BarinkEngine/Include/Input/InputManager.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
#include "Graphics/Window.h"
|
||||
|
||||
namespace BarinkEngine {
|
||||
|
||||
class InputManager {
|
||||
public:
|
||||
InputManager();
|
||||
|
||||
void PollEvents();
|
||||
void attach(BarinkWindow* window);
|
||||
|
||||
private:
|
||||
std::vector<BarinkWindow*> windows;
|
||||
};
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
static int HeapAllocations = 0;
|
||||
static int HeapDeallocations = 0;
|
||||
|
||||
inline void* operator new(std::size_t sz) {
|
||||
HeapAllocations++;
|
||||
return std::malloc(sz);
|
||||
}
|
||||
|
||||
inline void operator delete(void* ptr) noexcept {
|
||||
HeapDeallocations++;
|
||||
std::free(ptr);
|
||||
}
|
||||
|
28
BarinkEngine/Include/Scripting/LuaScript.h
Normal file
28
BarinkEngine/Include/Scripting/LuaScript.h
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
|
||||
#include "LuaScriptingManager.h"
|
||||
|
||||
|
||||
/*
|
||||
class LuaScript {
|
||||
public:
|
||||
|
||||
LuaScript(const std::string&);
|
||||
void execute(lua_State& l);
|
||||
|
||||
private:
|
||||
std::string filePath;
|
||||
|
||||
};
|
||||
|
||||
|
||||
*/
|
28
BarinkEngine/Include/Scripting/LuaScriptingManager.h
Normal file
28
BarinkEngine/Include/Scripting/LuaScriptingManager.h
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
|
||||
#include "LuaScript.h"
|
||||
|
||||
/*
|
||||
class LuaScriptingManager
|
||||
{
|
||||
public:
|
||||
std::vector<LuaScript*> scripts;
|
||||
|
||||
LuaScriptingManager();
|
||||
|
||||
void ExecuteLuaString(const std::string&);
|
||||
|
||||
private:
|
||||
lua_State* L;
|
||||
|
||||
lua_State& getState();
|
||||
};*/
|
Reference in New Issue
Block a user