Graphics Engine is now part of the whole engine instead, Project will

actually compile #9
This commit is contained in:
Nigel Barink 2022-05-28 13:32:17 +02:00
parent 3446bc2399
commit dae8830e2b
27 changed files with 401 additions and 394 deletions

View File

@ -1,4 +1,4 @@
#include "Include/BarinkEngine.h"
#include "BarinkEngine.h"
extern void Start(int argc, char* argv[]);
extern void UpdateApplication();
@ -31,4 +31,7 @@ int main(int argc, char* argv[]) {
}
void WARN(std::string message) {
spdlog::warn(message);
}

View File

@ -4,7 +4,7 @@
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define TINYGLTF_NO_EXTERNAL_IMAGE
#include "../MyGraphicsEngine/Mesh.h"
#include "Graphics/Mesh.h"
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

View File

@ -2,21 +2,19 @@
#include <iostream>
#include <string>
#include <filesystem>
#include "Engine.h"
#include <spdlog/spdlog.h>
/*
#include "../MemoryManager.h"
#include <glm/glm.hpp>
#include "glm/glm.hpp"
#include <MyGraphicsEngine/Shader.h>
#include <MyGraphicsEngine/Window.h>
#include <MyGraphicsEngine/Camera.h>
#include <MyGraphicsEngine/Renderable.h>
#include "graphics/Shader.h"
#include "graphics/Window.h"
#include "graphics/Camera.h"
#include "graphics/Renderable.h"
#include "spdlog/spdlog.h"
#include "MemoryManager.h"
extern "C"
{
@ -24,5 +22,4 @@ extern "C"
#include "lua.h"
#include "lualib.h"
}
*/
void WARN(std::string message);

View File

@ -1,7 +1,7 @@
#pragma once
namespace BarinkEngine {
static class Engine {
class Engine {
public:
static void Startup();
static void Shutdown();

View File

@ -5,12 +5,12 @@
static int HeapAllocations = 0;
static int HeapDeallocations = 0;
void* operator new(std::size_t sz) {
inline void* operator new(std::size_t sz) {
HeapAllocations++;
return std::malloc(sz);
}
void operator delete(void* ptr) noexcept {
inline void operator delete(void* ptr) noexcept {
HeapDeallocations++;
std::free(ptr);
}

View File

@ -1,4 +1,4 @@
#include "include/MyGraphicsEngine/Buffer.h"
#include "Graphics/Buffer.h"
int Buffer::getBufferID() {

View File

@ -1,4 +1,4 @@
#include "include/MyGraphicsEngine/Camera.h"
#include "Graphics/Camera.h"
Camera::Camera(glm::vec3 position, glm::vec3 rotation, float zoom)
: Position(position), Rotation(rotation), Zoom(zoom) {

View File

@ -1,4 +1,4 @@
#include "include/AssetManager/ModelImporter.h"
#include "AssetManager/ModelImporter.h"
void ModelImporter::ImportFBX(std::string path)

View File

@ -1,5 +1,7 @@
#include "include/MyGraphicsEngine/Renderable.h"
#include "include/AssetManager/ModelImporter.h"
#include "Graphics/Renderable.h"
#include "AssetManager/ModelImporter.h"
Renderable Renderable::Load()
{

View File

@ -1,4 +1,4 @@
#include "include/MyGraphicsEngine/Shader.h"
#include "Graphics/Shader.h"
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
{

View File

@ -1,4 +1,4 @@
#include "include/MyGraphicsEngine/VertexArray.h"
#include "Graphics/VertexArray.h"
#include <glad/glad.h>
void VertexArray::Create(){

View File

@ -1,4 +1,4 @@
#include "include/MyGraphicsEngine/Window.h"
#include "Graphics/Window.h"
#include <stdlib.h>
#include <stdio.h>

View File

@ -3,32 +3,56 @@ project "BarinkEngine"
buildmessage "Building BarinkEngine"
includedirs{
"./../libs/lua/include",
"./libs/spdlog/include",
includedirs {
"Include/",
"./../libs/glm",
"./../MyGraphicsEngine/include",
"../libs/lua/include",
"../libs/spdlog/include",
"../libs/glm",
"../libs/GorillaAudio/include",
"./../libs/GorillaAudio/include"
"../libs/assimp/include",
"../libs/glad/include",
"../libs/glfw/include",
"../libs/tinygltf",
"../libs/glew/include",
"../libs/glm",
"../libs/ImGui",
}
libdirs {
"./../libs/lua",
"./../libs/spdlog/build/Release"
"../libs/lua",
"../libs/spdlog/build/Release",
"../libs/assimp/lib/Debug",
"../libs/glfw/build/src/Debug",
"../libs/ImGui"
}
links {
"lua54",
"spdlog",
"MyGraphicsEngine"
"assimp-vc143-mtd",
"glfw3"
}
files {
"../libs/ImGui/*.cpp",
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
"../libs/glad/src/glad.c",
"./*.cpp",
"./*.h",
"./**/*.cpp",
"./**/*.h"
}
-- NOTE: make these copy instructions more flexible
ok, err = os.copyfile("graphics/shaders/fragment.shader", "../build/SandboxApplication/Debug/test.fs")
if err then error("Copy fragment shader source failed!") end
ok, err = os.copyfile("graphics/shaders/vertex.shader", "../build/SandboxApplication/Debug/test.vs")
if err then error("Copy vertex shader source failed!") end

View File

@ -1,49 +0,0 @@
project "MyGraphicsEngine"
kind "StaticLib"
buildmessage "Building MyGraphicsEngine ..."
includedirs {
"../libs/assimp/include",
"../libs/glad/include",
"../libs/glfw/include",
"../libs/tinygltf",
"../libs/glew/include",
"../libs/glm",
"../libs/ImGui",
}
libdirs{
"../libs/assimp/lib/Debug",
"../libs/glfw/build/src/Debug",
"../libs/ImGui"
}
links {
"assimp-vc143-mtd",
"glfw3",
}
files {
"../libs/ImGui/*.cpp",
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
"../libs/glad/src/glad.c",
"./*.cpp",
"./*.h",
"./**/*.cpp",
"./**/*.shader",
"./**/*.h"
}
-- NOTE: make these copy instructions more flexible
ok, err = os.copyfile("shaders/fragment.shader", "../build/SandboxApplication/Debug/test.fs")
if err then error("Copy fragment shader source failed!") end
ok, err = os.copyfile("shaders/vertex.shader", "../build/SandboxApplication/Debug/test.vs")
if err then error("Copy vertex shader source failed!") end

View File

@ -1,10 +1,20 @@
#include <BarinkEngine.h>
#include "BarinkEngine.h"
void Start(int argc, char* argv[]) {
std::cout << "Hello start!" << std::endl;
std::cout << "h" << std::endl;
// BarinkWindow GameWindow(800, 600);
char cwd[256];
memset(cwd, '\0', 256);
// getcwd(cwd, 256);
//spdlog::info("Working directory: {}", cwd);
WARN("Hello warning");
// BarinkWindow GameWindow(800, 600);
}

View File

@ -29,7 +29,29 @@ workspace "BarinkEngine"
}
includedirs{
"./BarinkEngine/include"
"./BarinkEngine/Include",
-- I'd prefer if didn't need these..
-- We'll figure that out some time later
"./libs/lua/include",
"./libs/spdlog/include",
"./libs/glm",
"./libs/GorillaAudio/include",
"./libs/assimp/include",
"./libs/glad/include",
"./libs/glfw/include",
"./libs/tinygltf",
"./libs/glew/include",
"./libs/glm",
"./libs/ImGui",
}
libdirs {
'./build/BarinkEngine/Debug'
}
files {
@ -38,6 +60,4 @@ workspace "BarinkEngine"
}
include("./BarinkEngine")
include("./MyGraphicsEngine")
include("./BarinkEngine")