Compare commits
3 Commits
82e0f473fb
...
Feature/Ba
Author | SHA1 | Date | |
---|---|---|---|
85f9c78adf | |||
4df6cfba90 | |||
7b9685c381 |
@ -2,6 +2,7 @@
|
|||||||
#include <phonon.h>
|
#include <phonon.h>
|
||||||
|
|
||||||
EngineStatistics* ES;
|
EngineStatistics* ES;
|
||||||
|
BarinkEngine::InputManager InputSystem;
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
// Setup performance sampler
|
// Setup performance sampler
|
||||||
@ -12,17 +13,21 @@ int main(int argc, char* argv[]) {
|
|||||||
BarinkWindow MainWindow = BarinkWindow(800, 600);
|
BarinkWindow MainWindow = BarinkWindow(800, 600);
|
||||||
|
|
||||||
BarinkEngine::Renderer renderer = BarinkEngine::Renderer();
|
BarinkEngine::Renderer renderer = BarinkEngine::Renderer();
|
||||||
BarinkEngine::InputManager InputSystem = BarinkEngine::InputManager();
|
InputSystem = BarinkEngine::InputManager();
|
||||||
|
|
||||||
InputSystem.attach(&MainWindow);
|
InputSystem.attach(&MainWindow);
|
||||||
|
|
||||||
GUIManager GUISystem = GUIManager(&MainWindow);
|
GUIManager GUISystem = GUIManager(&MainWindow);
|
||||||
|
|
||||||
|
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// First call to setup game
|
// First call to setup game
|
||||||
Start();
|
Start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Runtime loop
|
// Runtime loop
|
||||||
while (!MainWindow.WindowShouldClose()) {
|
while (!MainWindow.WindowShouldClose()) {
|
||||||
|
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*>{};
|
||||||
|
}
|
@ -20,3 +20,5 @@ extern void Start();
|
|||||||
extern void Update();
|
extern void Update();
|
||||||
extern void ImmediateGraphicsDraw();
|
extern void ImmediateGraphicsDraw();
|
||||||
extern void Stop();
|
extern void Stop();
|
||||||
|
|
||||||
|
extern BarinkEngine::InputManager InputSystem;
|
11
BarinkEngine/Include/EventSystem/Event.h
Normal file
11
BarinkEngine/Include/EventSystem/Event.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
struct Event
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::string name;
|
||||||
|
int argc;
|
||||||
|
void** argv;
|
||||||
|
|
||||||
|
};
|
16
BarinkEngine/Include/EventSystem/EventEmitter.h
Normal file
16
BarinkEngine/Include/EventSystem/EventEmitter.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Event.h"
|
||||||
|
#include "EventListener.h"
|
||||||
|
|
||||||
|
class EventEmitter {
|
||||||
|
public:
|
||||||
|
void Subscribe (EventListener& subscriber);
|
||||||
|
void Unsubscribe(EventListener& subscriber);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::list<EventListener*> subscribers;
|
||||||
|
void EmitEvent(Event& incident);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
};
|
@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
#include "../Include/EventSystem/EventListener.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BarinkWindow{
|
class BarinkWindow : EventListener {
|
||||||
private:
|
private:
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
bool FullScreen;
|
bool FullScreen;
|
||||||
@ -18,12 +19,15 @@ class BarinkWindow{
|
|||||||
static bool InitGLFW();
|
static bool InitGLFW();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BarinkWindow(const int width, const int height);
|
BarinkWindow(const int width, const int height);
|
||||||
~BarinkWindow();
|
~BarinkWindow();
|
||||||
|
|
||||||
GLFWwindow* windowptr();
|
GLFWwindow* windowptr();
|
||||||
|
|
||||||
|
void ReceiveEvent(Event& incident) override;
|
||||||
bool WindowShouldClose();
|
bool WindowShouldClose();
|
||||||
|
|
||||||
void Poll();
|
void Poll();
|
||||||
|
@ -1,18 +1,27 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Graphics/Window.h"
|
#include "Graphics/Window.h"
|
||||||
|
#include "EventSystem/EventEmitter.h"
|
||||||
|
|
||||||
namespace BarinkEngine {
|
namespace BarinkEngine {
|
||||||
|
|
||||||
class InputManager {
|
class InputManager : EventEmitter {
|
||||||
public:
|
public:
|
||||||
InputManager();
|
InputManager();
|
||||||
|
|
||||||
void PollEvents();
|
void PollEvents();
|
||||||
void attach(BarinkWindow* window);
|
void attach(BarinkWindow* window);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// GLFW Handlers
|
||||||
|
static void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
||||||
|
static void CursorPositionCallback(GLFWwindow* window, double x, double y);
|
||||||
|
static void CursorEnterCallback(GLFWwindow* window, int entered);
|
||||||
|
static void MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
|
||||||
|
static void ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
|
||||||
private:
|
private:
|
||||||
std::vector<BarinkWindow*> windows;
|
std::vector<BarinkWindow*> windows;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,118 @@
|
|||||||
|
#include "BarinkEngine.h"
|
||||||
#include "Input/InputManager.h"
|
#include "Input/InputManager.h"
|
||||||
|
#include "GLFW/glfw3.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
#include <iostream>
|
||||||
void BarinkEngine::InputManager::PollEvents()
|
void BarinkEngine::InputManager::PollEvents()
|
||||||
{
|
{
|
||||||
for (std::vector<BarinkWindow*>::iterator it = windows.begin(); it != windows.end(); ++it) {
|
for (auto it = windows.begin(); it != windows.end(); ++it) {
|
||||||
(*it)->Poll();
|
(*it)->Poll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BarinkEngine::InputManager::attach(BarinkWindow* window)
|
void BarinkEngine::InputManager::KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
windows.push_back(window);
|
|
||||||
|
Event KeyEvent{};
|
||||||
|
KeyEvent.name = "KEY";
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(KeyEvent);
|
||||||
|
|
||||||
|
|
||||||
|
if (key == GLFW_KEY_A && action == GLFW_PRESS)
|
||||||
|
{
|
||||||
|
|
||||||
|
std::cout << "'a' key was pressed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BarinkEngine::InputManager::InputManager()
|
void BarinkEngine::InputManager::CursorPositionCallback(GLFWwindow* window, double x, double y)
|
||||||
|
{
|
||||||
|
//std::cout << "Cursor Position x: " << x << ", y: " << y << std::endl;
|
||||||
|
Event CursorPosUpdate{};
|
||||||
|
CursorPosUpdate.name = "UPDATE::CURSOR:POSITION";
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(CursorPosUpdate);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BarinkEngine::InputManager::CursorEnterCallback(GLFWwindow* window, int entered)
|
||||||
|
{
|
||||||
|
if (entered) {
|
||||||
|
Event mouseEntered {};
|
||||||
|
mouseEntered.name = "Mouse Entered Window's confines!";
|
||||||
|
mouseEntered.argc = 0;
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(mouseEntered);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Event mouseLeft{};
|
||||||
|
mouseLeft.name = "Mouse Left Window's confines!";
|
||||||
|
mouseLeft.argc = 0;
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(mouseLeft);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BarinkEngine::InputManager::MouseButtonCallback(GLFWwindow* window, int button, int action, int mods)
|
||||||
|
{
|
||||||
|
|
||||||
|
Event MouseButtonEvent{};
|
||||||
|
MouseButtonEvent.name = "MOUSEBUTTON";
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(MouseButtonEvent);
|
||||||
|
|
||||||
|
|
||||||
|
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS) {
|
||||||
|
std::cout << "Right mouse button was pressed!" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BarinkEngine::InputManager::ScrollCallback(GLFWwindow* window, double xoffset, double yoffset)
|
||||||
|
{
|
||||||
|
std::cout << "Scroll: x: " << xoffset << ", y: " << yoffset << std::endl;
|
||||||
|
|
||||||
|
Event ScrollEvent{};
|
||||||
|
ScrollEvent.name = "SCROLL";
|
||||||
|
|
||||||
|
InputSystem.EmitEvent(ScrollEvent);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BarinkEngine::InputManager::attach(BarinkWindow* window)
|
||||||
|
{
|
||||||
|
|
||||||
|
windows.push_back(window);
|
||||||
|
|
||||||
|
// Attach callbacks
|
||||||
|
glfwSetKeyCallback(window->windowptr(), KeyCallback);
|
||||||
|
glfwSetCursorPosCallback(window->windowptr(), CursorPositionCallback);
|
||||||
|
glfwSetCursorEnterCallback(window->windowptr(), CursorEnterCallback);
|
||||||
|
glfwSetMouseButtonCallback(window->windowptr(), MouseButtonCallback);
|
||||||
|
glfwSetScrollCallback(window->windowptr(), ScrollCallback);
|
||||||
|
|
||||||
|
this->Subscribe( (EventListener&)(*window));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BarinkEngine::InputManager::InputManager() : EventEmitter ()
|
||||||
{
|
{
|
||||||
windows = std::vector<BarinkWindow*>();
|
windows = std::vector<BarinkWindow*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ std::vector<BarinkEngine::Mesh> ModelImporter::Test() {
|
|||||||
//spdlog::info("======= Assimp ======");
|
//spdlog::info("======= Assimp ======");
|
||||||
|
|
||||||
Assimp::Importer importer;
|
Assimp::Importer importer;
|
||||||
const aiScene* scene = importer.ReadFile("build/SandboxApplication/Debug/Cube.obj", aiProcess_Triangulate | aiProcess_FlipUVs);
|
const aiScene* scene = importer.ReadFile("build/SandboxApplication/Debug/Models/Cube.obj", aiProcess_Triangulate | aiProcess_FlipUVs);
|
||||||
|
|
||||||
aiNode* currentNode = scene->mRootNode;
|
aiNode* currentNode = scene->mRootNode;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ Renderable::Renderable()
|
|||||||
|
|
||||||
VAO.AttachAttribute(0, 3, sizeof(BarinkEngine::Vertex));
|
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);
|
glEnableVertexAttribArray(1);
|
||||||
|
|
||||||
vertexBuffer.Unbind(false);
|
vertexBuffer.Unbind(false);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "Graphics/Shader.h"
|
#include "Graphics/Shader.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
||||||
{
|
{
|
||||||
char infoLog[512];
|
char infoLog[512];
|
||||||
@ -15,7 +15,7 @@ Shader::Shader(const std::string vertexShaderPath, const std::string fragmentSha
|
|||||||
glGetShaderiv(vertId, GL_COMPILE_STATUS, &succes);
|
glGetShaderiv(vertId, GL_COMPILE_STATUS, &succes);
|
||||||
if(!succes){
|
if(!succes){
|
||||||
glGetShaderInfoLog(vertId, 512, NULL, infoLog);
|
glGetShaderInfoLog(vertId, 512, NULL, infoLog);
|
||||||
//spdlog::error( "Vertex shader has compile error {}", infoLog);
|
spdlog::error( "Vertex shader has compile error {}", infoLog);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ Shader::Shader(const std::string vertexShaderPath, const std::string fragmentSha
|
|||||||
glGetShaderiv(fragId, GL_COMPILE_STATUS, &succes);
|
glGetShaderiv(fragId, GL_COMPILE_STATUS, &succes);
|
||||||
if(!succes){
|
if(!succes){
|
||||||
glGetShaderInfoLog(fragId, 512, NULL, infoLog);
|
glGetShaderInfoLog(fragId, 512, NULL, infoLog);
|
||||||
//spdlog::error("Fragment shader has compile error {}", infoLog);
|
spdlog::error("Fragment shader has compile error {}", infoLog);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ char* Shader::readFile (const char* filePath){
|
|||||||
file.open(filePath);
|
file.open(filePath);
|
||||||
|
|
||||||
if(file.is_open() == false){
|
if(file.is_open() == false){
|
||||||
//spdlog::info("File not found.");
|
spdlog::info("File not found.");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
#version 440 core
|
#version 440 core
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
uniform vec3 Color;
|
uniform vec3 Color;
|
||||||
|
|
||||||
in vec2 TexCoord;
|
in vec2 TexCoord;
|
||||||
|
|
||||||
uniform sampler2D Texture;
|
uniform sampler2D Texture;
|
||||||
|
|
||||||
|
|
||||||
void main(){
|
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 "Graphics/Window.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <iostream>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
#include "../Include/EventSystem/Event.h"
|
||||||
|
|
||||||
bool BarinkWindow::InitGLFW(){
|
bool BarinkWindow::InitGLFW(){
|
||||||
if(!glfwInit())
|
if(!glfwInit())
|
||||||
@ -73,4 +74,11 @@ void BarinkWindow::Poll()
|
|||||||
void BarinkWindow::SwapBuffers()
|
void BarinkWindow::SwapBuffers()
|
||||||
{
|
{
|
||||||
glfwSwapBuffers(window);
|
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/physx/physx/include",
|
||||||
"../libs/steam-audio/include",
|
"../libs/steam-audio/include",
|
||||||
|
|
||||||
"../libs/assimp/include",
|
"../libs/assimp/include",
|
||||||
|
|
||||||
|
|
||||||
"../libs/glad/include",
|
"../libs/glad/include",
|
||||||
|
|
||||||
"../libs/glfw/include",
|
"../libs/glfw/include",
|
||||||
-- "../libs/tinygltf",
|
|
||||||
"../libs/glew/include",
|
"../libs/glew/include",
|
||||||
"../libs/glm",
|
"../libs/glm",
|
||||||
|
|
||||||
"../libs/ImGui",
|
"../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 {
|
libdirs {
|
||||||
"../libs/steam-audio/lib/windows-x64",
|
"../libs/steam-audio/lib/windows-x64",
|
||||||
"../libs/lua",
|
"../libs/lua",
|
||||||
"../libs/spdlog/build/Release",
|
"../libs/spdlog/build/Release",
|
||||||
"../libs/assimp/lib/Debug",
|
"../libs/assimp/lib/Debug",
|
||||||
"../libs/glfw/build/src/Debug",
|
"../libs/glfw/build/src/Debug",
|
||||||
"../libs/ImGui"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
files {
|
files {
|
||||||
"../libs/ImGui/*.cpp",
|
|
||||||
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
|
|
||||||
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
|
|
||||||
"../libs/glad/src/glad.c",
|
"../libs/glad/src/glad.c",
|
||||||
|
|
||||||
"./*.cpp",
|
"./*.cpp",
|
||||||
@ -45,6 +59,7 @@ project "BarinkEngine"
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
filter { "system:windows"}
|
filter { "system:windows"}
|
||||||
prebuildcommands {
|
prebuildcommands {
|
||||||
-- Copy shaders
|
-- Copy shaders
|
||||||
@ -54,14 +69,7 @@ project "BarinkEngine"
|
|||||||
"copy graphics\\shaders\\RenderSurfaceVert.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.vs"
|
"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" }
|
filter { "system:linux" }
|
||||||
prebuildcommands {
|
prebuildcommands {
|
||||||
@ -71,3 +79,5 @@ project "BarinkEngine"
|
|||||||
"cp graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
|
"cp graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
|
||||||
"cp graphics/shaders/RenderSurfaceVert.shader ../build/SandboxApplication/Debug/RenderSurface.vs"
|
"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"
|
||||||
|
}
|
@ -58,7 +58,7 @@ void Start() {
|
|||||||
|
|
||||||
shader = new Shader(vertexShaderSource, fragmentShaderSource);
|
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 = new Material(*shader);
|
||||||
matCube->Color = glm::vec3(1.0, 0.0, 0.0);
|
matCube->Color = glm::vec3(1.0, 0.0, 0.0);
|
||||||
|
Reference in New Issue
Block a user