FIXED inputsystem linker error

This commit is contained in:
Nigel Barink 2022-08-15 21:15:12 +02:00
parent ab5599f1fc
commit db6def3bc9
11 changed files with 49 additions and 56 deletions

View File

@ -15,10 +15,7 @@
#include "Scene.h"
#include "PerfCounter.h"
extern void Start();
extern void Update();
extern void ImmediateGraphicsDraw();
extern void Stop();
extern BarinkEngine::InputManager InputSystem;

View File

@ -1,5 +0,0 @@
#include "EventListener.h"
void EventListener::ReceiveEvent(Event& incident)
{
}

View File

@ -1,8 +1,12 @@
#pragma once
#include "Event.h"
#include <list>
#include <iostream>
#include "spdlog/spdlog.h"
#include "Event.h"
class EventListener{
public:
virtual void ReceiveEvent(Event& incident);
virtual void ReceiveEvent(Event& incident) = 0 ;
};

View File

@ -2,12 +2,15 @@
#define GLFW_STATIC
#include <glad/glad.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <GLFW/glfw3.h>
#include "../Include/EventSystem/EventListener.h"
#include <spdlog/spdlog.h>
#include "EventSystem/Event.h"
#include "EventSystem/EventListener.h"
class BarinkWindow : EventListener {
private:
@ -18,16 +21,13 @@ class BarinkWindow : EventListener {
static bool InitGLFW();
public:
BarinkWindow(const int width, const int height);
~BarinkWindow();
GLFWwindow* windowptr();
void ReceiveEvent(Event& incident) override;
void ReceiveEvent(Event& incident) override ;
bool WindowShouldClose();
void Poll();

View File

@ -1,7 +1,11 @@
#pragma once
#include <vector>
#include "Graphics/Window.h"
#include <iostream>
#include "spdlog/spdlog.h"
#include "EventSystem/EventEmitter.h"
#include "EventSystem/EventListener.h"
#include "Graphics/Window.h"
namespace BarinkEngine {
@ -12,8 +16,6 @@ namespace BarinkEngine {
void PollEvents();
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);
@ -25,3 +27,5 @@ namespace BarinkEngine {
};
}
extern BarinkEngine::InputManager InputSystem;

View File

@ -63,10 +63,10 @@ project "BarinkEngine"
filter { "system:windows"}
prebuildcommands {
-- Copy shaders
"copy graphics\\shaders\\fragment.shader ..\\build\\SandboxApplication\\Debug\\test.fs",
"copy graphics\\shaders\\vertex.shader ..\\build\\SandboxApplication\\Debug\\test.vs",
"copy graphics\\shaders\\RenderSurfaceFrag.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.fs",
"copy graphics\\shaders\\RenderSurfaceVert.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.vs"
"copy src\\graphics\\shaders\\fragment.shader ..\\build\\SandboxApplication\\Debug\\test.fs",
"copy src\\graphics\\shaders\\vertex.shader ..\\build\\SandboxApplication\\Debug\\test.vs",
"copy src\\graphics\\shaders\\RenderSurfaceFrag.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.fs",
"copy src\\graphics\\shaders\\RenderSurfaceVert.shader ..\\build\\SandboxApplication\\Debug\\RenderSurface.vs"
}
@ -74,10 +74,10 @@ project "BarinkEngine"
filter { "system:linux" }
prebuildcommands {
-- Copy shaders
"cp graphics/shaders/fragment.shader ../build/SandboxApplication/Debug/test.fs",
"cp graphics/shaders/vertex.shader ../build/SandboxApplication/Debug/test.vs",
"cp graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
"cp graphics/shaders/RenderSurfaceVert.shader ../build/SandboxApplication/Debug/RenderSurface.vs"
"cp src/graphics/shaders/fragment.shader ../build/SandboxApplication/Debug/test.fs",
"cp src/graphics/shaders/vertex.shader ../build/SandboxApplication/Debug/test.vs",
"cp src/graphics/shaders/RenderSurfaceFrag.shader ../build/SandboxApplication/Debug/RenderSurface.fs",
"cp src/graphics/shaders/RenderSurfaceVert.shader ../build/SandboxApplication/Debug/RenderSurface.vs"
}
include('../ImGui')

View File

@ -1,8 +1,6 @@
#include "BarinkEngine.h"
#include <phonon.h>
EngineStatistics* ES;
BarinkEngine::InputManager InputSystem;
int main(int argc, char* argv[]) {
// Setup performance sampler

View File

@ -13,6 +13,7 @@ BarinkEngine::SceneObject* BarinkEngine::ModelImporter::Import(const std::string
std::vector<BarinkEngine::Mesh> meshes = processNode(currentNode, scene);
return root;
}

View File

@ -1,10 +1,4 @@
#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())
@ -76,9 +70,8 @@ void BarinkWindow::SwapBuffers()
glfwSwapBuffers(window);
}
void BarinkWindow::ReceiveEvent(Event& incident)
{
std::cout << "EVENT RECEIVED: " << incident.name << std::endl;
}
}

View File

@ -1,12 +1,12 @@
#include "BarinkEngine.h"
#include "Input/InputManager.h"
#include "GLFW/glfw3.h"
#include "spdlog/spdlog.h"
#include <iostream>
BarinkEngine::InputManager InputSystem;
void BarinkEngine::InputManager::PollEvents()
{
for (auto it = windows.begin(); it != windows.end(); ++it) {
(*it)->Poll();
auto window = *it;
window->Poll();
}
}

View File

@ -21,7 +21,7 @@ const std::string fragmentShaderSource = "build/SandboxApplication/Debug/test.fs
BarinkEngine::ModelImporter* MI = new BarinkEngine::ModelImporter();
Scene* Level1;
// BarinkEngine::SceneObject* cube;
/*
* Runs once at startup
* - USe to initialize the game/sandbox/demo
@ -38,8 +38,10 @@ void Start() {
// Create a cube node
// Load a model
// *(MI->Import("build/SandboxApplication/Debug/Models/Cube.obj"))
//cube = MI->Import("build/SandboxApplication/Debug/Models/Cube.obj");
//Level1->GetRoot().addChild(*cube);
std::string groupName("Nested-Group");
auto testGroup = new Group(groupName);
Level1->GetRoot().addChild( *testGroup);
@ -89,23 +91,22 @@ void Update()
* NOTE: this needs to move to the renderer
* Render code should not appear in the sandbox file
*/
glm::mat4 projection = glm::perspective(glm::radians(cam->Zoom), (800.0f / 600.0f), 0.001f, 100.0f);
//glm::mat4 projection = glm::perspective(glm::radians(cam->Zoom), (800.0f / 600.0f), 0.001f, 100.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
shader->Use();
shader->setUniformMat4("P", projection);
//shader->setUniformMat4("M", CalculateModelMat(Cube->transform));
//shader->setUniformMat4("P", projection);
//shader->setUniformMat4("M", CalculateModelMat(cube->transform));
shader->setUniformMat4("V", cam->GetViewMatrix());
//matCube->Apply();
//cube->renderable->material->Apply();
//Cube->Draw();
//shader->setUniformMat4("M", CalculateModelMat(Cube2->transform));
// matCube2->Apply();
//Cube2->Draw();
}
/*