Compare commits
4 Commits
82e0f473fb
...
Feature/In
Author | SHA1 | Date | |
---|---|---|---|
3c30bf7fb7 | |||
85f9c78adf | |||
4df6cfba90 | |||
7b9685c381 |
@ -1,28 +1,48 @@
|
||||
#include "BarinkEngine.h"
|
||||
#include <phonon.h>
|
||||
|
||||
EngineStatistics* ES;
|
||||
BarinkEngine::InputManager InputSystem;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// Setup performance sampler
|
||||
PerfomanceSamplerInit();
|
||||
|
||||
|
||||
// Startup services
|
||||
BarinkWindow MainWindow = BarinkWindow(800, 600);
|
||||
// Create the window
|
||||
BarinkWindow MainWindow = BarinkWindow(800, 600);
|
||||
|
||||
// =================================================
|
||||
// Startup services
|
||||
// =================================================
|
||||
|
||||
// Startup Renderer
|
||||
BarinkEngine::Renderer renderer = BarinkEngine::Renderer();
|
||||
BarinkEngine::InputManager InputSystem = BarinkEngine::InputManager();
|
||||
|
||||
|
||||
// Startup InputManager
|
||||
InputSystem = BarinkEngine::InputManager();
|
||||
|
||||
InputSystem.attach(&MainWindow);
|
||||
InputSystem.setupGLFWInput(MainWindow.windowptr());
|
||||
|
||||
|
||||
|
||||
// Startup GUI System
|
||||
GUIManager GUISystem = GUIManager(&MainWindow);
|
||||
|
||||
|
||||
|
||||
|
||||
// Enable depth testing
|
||||
// NOTE: TODO Move this into the renderer
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
|
||||
|
||||
// First call to setup game
|
||||
Start();
|
||||
|
||||
|
||||
|
||||
// Runtime loop
|
||||
while (!MainWindow.WindowShouldClose()) {
|
||||
@ -53,6 +73,9 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// Shutdown Services
|
||||
delete ES;
|
||||
InputSystem.detach(&MainWindow);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
25
BarinkEngine/EventSystem/EventEmitter.cpp
Normal file
25
BarinkEngine/EventSystem/EventEmitter.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "../Include/EventSystem/EventEmitter.h"
|
||||
|
||||
|
||||
void EventEmitter::Subscribe(EventListener& subscriber)
|
||||
{
|
||||
subscribers.push_back(&subscriber);
|
||||
}
|
||||
|
||||
void EventEmitter::Unsubscribe(EventListener& subscriber)
|
||||
{
|
||||
subscribers.remove(&subscriber);
|
||||
}
|
||||
|
||||
void EventEmitter::EmitEvent(Event& incident)
|
||||
{
|
||||
// Notify all subscribers an event has taken place
|
||||
for (auto it = subscribers.begin(); it != subscribers.end(); ++it)
|
||||
{
|
||||
(*it)->ReceiveEvent(incident);
|
||||
}
|
||||
}
|
||||
|
||||
EventEmitter::EventEmitter() {
|
||||
subscribers = std::list<EventListener*>{};
|
||||
}
|
@ -11,16 +11,13 @@
|
||||
#include <string>
|
||||
|
||||
class ModelImporter {
|
||||
|
||||
public:
|
||||
static std::vector<BarinkEngine::Mesh> Import(std::string path);
|
||||
|
||||
|
||||
private:
|
||||
void ImportFBX(std::string path);
|
||||
void ImportBlend(std::string path);
|
||||
void ImportGLTF(std::string path);
|
||||
void ImportOBJ(std::string path);
|
||||
static BarinkEngine::Mesh ModelImporter::processMesh(aiMesh* mesh, const aiScene* scene);
|
||||
static std::vector<BarinkEngine::Mesh> ModelImporter::processNode(aiNode* node, const aiScene* scene);
|
||||
|
||||
public:
|
||||
void Import(std::string path);
|
||||
|
||||
static std::vector<BarinkEngine::Mesh> Test();
|
||||
};
|
@ -13,6 +13,8 @@
|
||||
#include "Graphics/Renderer.h"
|
||||
#include "Graphics/GUI/GUIManager.h"
|
||||
#include "Scene.h"
|
||||
|
||||
|
||||
#include "PerfCounter.h"
|
||||
|
||||
|
||||
@ -20,3 +22,5 @@ extern void Start();
|
||||
extern void Update();
|
||||
extern void ImmediateGraphicsDraw();
|
||||
extern void Stop();
|
||||
|
||||
extern BarinkEngine::InputManager InputSystem;
|
9
BarinkEngine/Include/EventSystem/Event.h
Normal file
9
BarinkEngine/Include/EventSystem/Event.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
struct Event
|
||||
{
|
||||
public:
|
||||
std::string name;
|
||||
|
||||
};
|
18
BarinkEngine/Include/EventSystem/EventEmitter.h
Normal file
18
BarinkEngine/Include/EventSystem/EventEmitter.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "Event.h"
|
||||
#include "EventListener.h"
|
||||
|
||||
class EventEmitter {
|
||||
public:
|
||||
void Subscribe (EventListener& subscriber);
|
||||
void Unsubscribe(EventListener& subscriber);
|
||||
void EmitEvent(Event& incident);
|
||||
|
||||
|
||||
protected:
|
||||
std::list<EventListener*> subscribers;
|
||||
|
||||
|
||||
EventEmitter();
|
||||
|
||||
};
|
5
BarinkEngine/Include/EventSystem/EventListener.cpp
Normal file
5
BarinkEngine/Include/EventSystem/EventListener.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "EventListener.h"
|
||||
|
||||
void EventListener::ReceiveEvent(Event& incident)
|
||||
{
|
||||
}
|
8
BarinkEngine/Include/EventSystem/EventListener.h
Normal file
8
BarinkEngine/Include/EventSystem/EventListener.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include "Event.h"
|
||||
#include <list>
|
||||
class EventListener{
|
||||
public:
|
||||
virtual void ReceiveEvent(Event& incident);
|
||||
|
||||
};
|
18
BarinkEngine/Include/EventSystem/InputSystemEvents.h
Normal file
18
BarinkEngine/Include/EventSystem/InputSystemEvents.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "Event.h"
|
||||
|
||||
|
||||
struct KEY_DOWN_EVENT : public Event {
|
||||
public:
|
||||
int scancode;
|
||||
int keycode;
|
||||
int mods;
|
||||
};
|
||||
|
||||
struct KEY_UP_EVENT : public Event {
|
||||
public:
|
||||
int scancode;
|
||||
int keycode;
|
||||
int mods;
|
||||
|
||||
};
|
@ -28,10 +28,10 @@ public:
|
||||
|
||||
~Renderable();
|
||||
|
||||
static Renderable* Load();
|
||||
static Renderable* Load(std::string& path);
|
||||
void Draw();
|
||||
|
||||
private:
|
||||
std::vector<BarinkEngine::Mesh> meshes;
|
||||
Renderable();
|
||||
Renderable(std::string& path);
|
||||
};
|
@ -3,12 +3,13 @@
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "../Include/EventSystem/EventListener.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class BarinkWindow{
|
||||
class BarinkWindow : EventListener {
|
||||
private:
|
||||
GLFWwindow* window;
|
||||
bool FullScreen;
|
||||
@ -18,12 +19,15 @@ class BarinkWindow{
|
||||
static bool InitGLFW();
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
BarinkWindow(const int width, const int height);
|
||||
~BarinkWindow();
|
||||
|
||||
GLFWwindow* windowptr();
|
||||
|
||||
void ReceiveEvent(Event& incident) override;
|
||||
bool WindowShouldClose();
|
||||
|
||||
void Poll();
|
||||
|
14
BarinkEngine/Include/Input/GLFWInput.h
Normal file
14
BarinkEngine/Include/Input/GLFWInput.h
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
namespace BarinkEngine {
|
||||
namespace Input {
|
||||
|
||||
void BE_GLFW_KEYS(GLFWwindow* window, int key, int scancode, int action, int mods);
|
||||
void BE_GLFW_CURSOR_POSITION(GLFWwindow* window, double x, double y);
|
||||
void BE_GLFW_CURSOR_ENTER(GLFWwindow* window, int entered);
|
||||
void BE_GLFW_MOUSE_BUTTON(GLFWwindow* window, int button, int action, int mods);
|
||||
void BE_GLFW_SCROLL(GLFWwindow* window, double xoffset, double yoffset);
|
||||
|
||||
}
|
||||
}
|
@ -1,18 +1,29 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
#include "Graphics/Window.h"
|
||||
#include "EventSystem/EventEmitter.h"
|
||||
#include "../Include/Input/GLFWInput.h"
|
||||
#include "BarinkEngine.h"
|
||||
|
||||
namespace BarinkEngine {
|
||||
|
||||
class InputManager {
|
||||
class InputManager : public EventEmitter {
|
||||
public:
|
||||
InputManager();
|
||||
|
||||
void PollEvents();
|
||||
|
||||
void attach(BarinkWindow* window);
|
||||
void detach(BarinkWindow* window);
|
||||
|
||||
|
||||
void setupGLFWInput(GLFWwindow* window);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
std::vector<BarinkWindow*> windows;
|
||||
std::list<BarinkWindow*> windows;
|
||||
|
||||
};
|
||||
}
|
||||
|
104
BarinkEngine/Input/GLFWInput.cpp
Normal file
104
BarinkEngine/Input/GLFWInput.cpp
Normal file
@ -0,0 +1,104 @@
|
||||
#include "BarinkEngine.h"
|
||||
#include "../Include/Input/GLFWInput.h"
|
||||
#include "../Include/EventSystem/InputSystemEvents.h"
|
||||
#include "../Include/Input/InputManager.h"
|
||||
|
||||
|
||||
namespace BarinkEngine {
|
||||
namespace Input {
|
||||
|
||||
|
||||
void BE_GLFW_KEYS(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GLFW_KEY_DOWN: {
|
||||
KEY_DOWN_EVENT keydown{};
|
||||
keydown.name = "KEY::DOWN";
|
||||
keydown.mods = mods;
|
||||
keydown.scancode = scancode;
|
||||
keydown.keycode = key;
|
||||
|
||||
InputSystem.EmitEvent(keydown);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case GLFW_KEY_UP: {
|
||||
KEY_UP_EVENT keyup{};
|
||||
keyup.name = "KEY::DOWN";
|
||||
keyup.mods = mods;
|
||||
keyup.scancode = scancode;
|
||||
keyup.keycode = key;
|
||||
|
||||
InputSystem.EmitEvent(keyup);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
Event KeyEvent{};
|
||||
KeyEvent.name = "KEY";
|
||||
|
||||
InputSystem.EmitEvent(KeyEvent);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BE_GLFW_CURSOR_POSITION(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
Event CursorPosUpdate{};
|
||||
CursorPosUpdate.name = "UPDATE::CURSOR:POSITION";
|
||||
|
||||
InputSystem.EmitEvent(CursorPosUpdate);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BE_GLFW_CURSOR_ENTER(GLFWwindow* window, int entered)
|
||||
{
|
||||
if (entered) {
|
||||
Event mouseEntered{};
|
||||
mouseEntered.name = "Mouse Entered Window's confines!";
|
||||
|
||||
InputSystem.EmitEvent(mouseEntered);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
Event mouseLeft{};
|
||||
mouseLeft.name = "Mouse Left Window's confines!";
|
||||
|
||||
InputSystem.EmitEvent(mouseLeft);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BE_GLFW_MOUSE_BUTTON(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
Event MouseButtonEvent{};
|
||||
MouseButtonEvent.name = "MOUSEBUTTON";
|
||||
|
||||
InputSystem.EmitEvent(MouseButtonEvent);
|
||||
}
|
||||
|
||||
|
||||
void BE_GLFW_SCROLL(GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
Event ScrollEvent{};
|
||||
ScrollEvent.name = "SCROLL";
|
||||
|
||||
InputSystem.EmitEvent(ScrollEvent);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +1,44 @@
|
||||
#include "Input/InputManager.h"
|
||||
|
||||
void BarinkEngine::InputManager::PollEvents()
|
||||
{
|
||||
for (std::vector<BarinkWindow*>::iterator it = windows.begin(); it != windows.end(); ++it) {
|
||||
(*it)->Poll();
|
||||
namespace BarinkEngine {
|
||||
|
||||
void InputManager::PollEvents()
|
||||
{
|
||||
for (auto it = windows.begin(); it != windows.end(); ++it) {
|
||||
(*it)->Poll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InputManager::setupGLFWInput(GLFWwindow* window) {
|
||||
// Attach callbacks
|
||||
glfwSetKeyCallback(window, BarinkEngine::Input::BE_GLFW_KEYS);
|
||||
glfwSetCursorPosCallback(window, BarinkEngine::Input::BE_GLFW_CURSOR_POSITION);
|
||||
glfwSetCursorEnterCallback(window, BarinkEngine::Input::BE_GLFW_CURSOR_ENTER);
|
||||
glfwSetMouseButtonCallback(window, BarinkEngine::Input::BE_GLFW_MOUSE_BUTTON);
|
||||
glfwSetScrollCallback(window, BarinkEngine::Input::BE_GLFW_SCROLL);
|
||||
}
|
||||
|
||||
|
||||
void InputManager::attach(BarinkWindow* window)
|
||||
{
|
||||
windows.push_back(window);
|
||||
this->Subscribe((EventListener&)(*window));
|
||||
|
||||
}
|
||||
|
||||
void InputManager::detach(BarinkWindow* window)
|
||||
{
|
||||
windows.remove(window);
|
||||
this->Unsubscribe((EventListener&)*window);
|
||||
}
|
||||
|
||||
|
||||
InputManager::InputManager() : EventEmitter()
|
||||
{
|
||||
windows = std::list<BarinkWindow*>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BarinkEngine::InputManager::attach(BarinkWindow* window)
|
||||
{
|
||||
windows.push_back(window);
|
||||
}
|
||||
|
||||
BarinkEngine::InputManager::InputManager()
|
||||
{
|
||||
windows = std::vector<BarinkWindow*>();
|
||||
}
|
||||
|
@ -1,66 +1,13 @@
|
||||
#include "AssetManager/ModelImporter.h"
|
||||
|
||||
|
||||
void ModelImporter::ImportFBX(std::string path)
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::Import(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportFBX not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportBlend(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportBlend not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportGLTF(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportGLTF not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportOBJ(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportOBJ not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::Import(std::string path)
|
||||
{
|
||||
//spdlog::warn("Import not implemented!");
|
||||
}
|
||||
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::Test() {
|
||||
|
||||
/*
|
||||
spdlog::info("====== Tiny GLTF ======");
|
||||
tinygltf::Model loadedModel;
|
||||
tinygltf::TinyGLTF loader;
|
||||
std::string error;
|
||||
std::string warn;
|
||||
bool ret = loader.LoadASCIIFromFile(&loadedModel, &error, &warn, "./Build/SandboxApplication/Debug/sponza.gltf");
|
||||
|
||||
if (!warn.empty())
|
||||
spdlog::warn("TinyGLTF Warning: {}", warn);
|
||||
if (!error.empty())
|
||||
spdlog::error("TinyGLTF Error: {}", error);
|
||||
if (!ret) {
|
||||
spdlog::error("TinyGLTF Error: Failed to parse glTF");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
spdlog::info("Meshes in model: {}", loadedModel.meshes.size());
|
||||
spdlog::info("Primitives in mesh: {}", loadedModel.meshes[0].primitives.size());
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//spdlog::info("======= Assimp ======");
|
||||
|
||||
Assimp::Importer importer;
|
||||
const aiScene* scene = importer.ReadFile("build/SandboxApplication/Debug/Cube.obj", aiProcess_Triangulate | aiProcess_FlipUVs);
|
||||
|
||||
const aiScene* scene = importer.ReadFile(path.c_str(), aiProcess_Triangulate | aiProcess_FlipUVs);
|
||||
aiNode* currentNode = scene->mRootNode;
|
||||
|
||||
return processNode(currentNode, scene);
|
||||
|
||||
|
||||
return processNode(currentNode, scene);
|
||||
}
|
||||
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::processNode(aiNode* node, const aiScene* scene) {
|
||||
|
@ -3,14 +3,14 @@
|
||||
#include "PerfCounter.h"
|
||||
|
||||
|
||||
Renderable* Renderable::Load()
|
||||
Renderable* Renderable::Load(std::string& path)
|
||||
{
|
||||
return new Renderable();
|
||||
return new Renderable(path);
|
||||
}
|
||||
|
||||
Renderable::Renderable()
|
||||
Renderable::Renderable(std::string& path)
|
||||
{
|
||||
meshes = ModelImporter::Test();
|
||||
meshes = ModelImporter::Import(path);
|
||||
|
||||
transform.Scale = glm::vec3(1.0f);
|
||||
transform.Rotation = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
@ -30,7 +30,7 @@ Renderable::Renderable()
|
||||
|
||||
VAO.AttachAttribute(0, 3, sizeof(BarinkEngine::Vertex));
|
||||
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(BarinkEngine::Vertex),(void*) offsetof(BarinkEngine::Vertex, vertices));
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(BarinkEngine::Vertex),(void* )offsetof(BarinkEngine::Vertex, vertices));
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
vertexBuffer.Unbind(false);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "Graphics/Shader.h"
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
||||
{
|
||||
char infoLog[512];
|
||||
@ -15,7 +15,7 @@ Shader::Shader(const std::string vertexShaderPath, const std::string fragmentSha
|
||||
glGetShaderiv(vertId, GL_COMPILE_STATUS, &succes);
|
||||
if(!succes){
|
||||
glGetShaderInfoLog(vertId, 512, NULL, infoLog);
|
||||
//spdlog::error( "Vertex shader has compile error {}", infoLog);
|
||||
spdlog::error( "Vertex shader has compile error {}", infoLog);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ Shader::Shader(const std::string vertexShaderPath, const std::string fragmentSha
|
||||
glGetShaderiv(fragId, GL_COMPILE_STATUS, &succes);
|
||||
if(!succes){
|
||||
glGetShaderInfoLog(fragId, 512, NULL, infoLog);
|
||||
//spdlog::error("Fragment shader has compile error {}", infoLog);
|
||||
spdlog::error("Fragment shader has compile error {}", infoLog);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ char* Shader::readFile (const char* filePath){
|
||||
file.open(filePath);
|
||||
|
||||
if(file.is_open() == false){
|
||||
//spdlog::info("File not found.");
|
||||
spdlog::info("File not found.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
#version 440 core
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform vec3 Color;
|
||||
|
||||
in vec2 TexCoord;
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
|
||||
void main(){
|
||||
FragColor = mix ( texture(Texture, TexCoord), vec4(Color, 1.0f));
|
||||
FragColor = mix ( texture(Texture, TexCoord), vec4(Color, 1.0f), 0.5f);
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
#include "Graphics/Window.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include "../Include/EventSystem/Event.h"
|
||||
|
||||
bool BarinkWindow::InitGLFW(){
|
||||
if(!glfwInit())
|
||||
@ -73,4 +74,14 @@ void BarinkWindow::Poll()
|
||||
void BarinkWindow::SwapBuffers()
|
||||
{
|
||||
glfwSwapBuffers(window);
|
||||
}
|
||||
|
||||
|
||||
void BarinkWindow::ReceiveEvent(Event& incident)
|
||||
{
|
||||
|
||||
|
||||
|
||||
std::cout << "EVENT RECEIVED: " << incident.name << std::endl;
|
||||
|
||||
}
|
@ -13,29 +13,43 @@ project "BarinkEngine"
|
||||
|
||||
"../libs/physx/physx/include",
|
||||
"../libs/steam-audio/include",
|
||||
|
||||
"../libs/assimp/include",
|
||||
|
||||
|
||||
"../libs/glad/include",
|
||||
|
||||
"../libs/glfw/include",
|
||||
-- "../libs/tinygltf",
|
||||
"../libs/glew/include",
|
||||
"../libs/glm",
|
||||
|
||||
"../libs/ImGui",
|
||||
}
|
||||
|
||||
links {
|
||||
-- This needs to fall under the filter as the names can differ on different platforms
|
||||
"phonon",
|
||||
"lua54",
|
||||
"spdlog",
|
||||
"assimp-vc143-mtd",
|
||||
"glfw3",
|
||||
|
||||
"ImGUI_Opengl3",
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
libdirs {
|
||||
"../libs/steam-audio/lib/windows-x64",
|
||||
"../libs/lua",
|
||||
"../libs/spdlog/build/Release",
|
||||
"../libs/assimp/lib/Debug",
|
||||
"../libs/glfw/build/src/Debug",
|
||||
"../libs/ImGui"
|
||||
}
|
||||
|
||||
files {
|
||||
"../libs/ImGui/*.cpp",
|
||||
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
|
||||
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
|
||||
"../libs/glad/src/glad.c",
|
||||
|
||||
"./*.cpp",
|
||||
@ -45,6 +59,7 @@ project "BarinkEngine"
|
||||
}
|
||||
|
||||
|
||||
|
||||
filter { "system:windows"}
|
||||
prebuildcommands {
|
||||
-- Copy shaders
|
||||
@ -54,14 +69,7 @@ project "BarinkEngine"
|
||||
"copy graphics\\shaders\\RenderSurfaceVert.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.vs"
|
||||
}
|
||||
|
||||
links {
|
||||
-- This needs to fall under the filter as the names can differ on different platforms
|
||||
"phonon",
|
||||
"lua54",
|
||||
"spdlog",
|
||||
"assimp-vc143-mtd",
|
||||
"glfw3"
|
||||
}
|
||||
|
||||
|
||||
filter { "system:linux" }
|
||||
prebuildcommands {
|
||||
@ -71,3 +79,5 @@ project "BarinkEngine"
|
||||
"cp graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
|
||||
"cp graphics/shaders/RenderSurfaceVert.shader ../build/SandboxApplication/Debug/RenderSurface.vs"
|
||||
}
|
||||
|
||||
include('../ImGui')
|
||||
|
18
ImGui/premake5.lua
Normal file
18
ImGui/premake5.lua
Normal file
@ -0,0 +1,18 @@
|
||||
project "ImGUI_Opengl3"
|
||||
kind "StaticLib"
|
||||
|
||||
includedirs {
|
||||
"../libs/glfw/include",
|
||||
"../libs/ImGui"
|
||||
}
|
||||
|
||||
files {
|
||||
"../libs/ImGui/*.cpp",
|
||||
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
|
||||
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
|
||||
}
|
||||
|
||||
libdirs{
|
||||
"../libs/ImGui",
|
||||
"../libs/glad"
|
||||
}
|
BIN
Manuals/GLSL.std.450.pdf
Normal file
BIN
Manuals/GLSL.std.450.pdf
Normal file
Binary file not shown.
BIN
Manuals/SPIRV.pdf
Normal file
BIN
Manuals/SPIRV.pdf
Normal file
Binary file not shown.
@ -58,7 +58,7 @@ void Start() {
|
||||
|
||||
shader = new Shader(vertexShaderSource, fragmentShaderSource);
|
||||
|
||||
textureCube = new Texture("build/SandboxApplication/Debug/die.jpg");
|
||||
textureCube = new Texture("build/SandboxApplication/Debug/Textures/wall.jpg");
|
||||
|
||||
matCube = new Material(*shader);
|
||||
matCube->Color = glm::vec3(1.0, 0.0, 0.0);
|
||||
@ -66,11 +66,13 @@ void Start() {
|
||||
matCube2 = new Material(*shader);
|
||||
matCube2->Color = glm::vec3(0.0, 1.0f, 0.0);
|
||||
|
||||
std::string cubePath = "build/SandboxApplication/Debug/Models/Cube.obj";
|
||||
std::string lanternPath = "build/SandboxApplication/Debug/Models/Latern.gltf";
|
||||
/*
|
||||
* load meshes
|
||||
*/
|
||||
Cube = Renderable::Load();
|
||||
Cube2 = Renderable::Load();
|
||||
Cube = Renderable::Load(lanternPath);
|
||||
Cube2 = Renderable::Load(cubePath);
|
||||
Cube->addChild(*Cube2);
|
||||
|
||||
Cube->shader = shader;
|
||||
|
Reference in New Issue
Block a user