Graphics Engine is now part of the whole engine instead, Project will
actually compile #9
This commit is contained in:
parent
3446bc2399
commit
dae8830e2b
@ -1,4 +1,4 @@
|
|||||||
#include "Include/BarinkEngine.h"
|
#include "BarinkEngine.h"
|
||||||
|
|
||||||
extern void Start(int argc, char* argv[]);
|
extern void Start(int argc, char* argv[]);
|
||||||
extern void UpdateApplication();
|
extern void UpdateApplication();
|
||||||
@ -31,4 +31,7 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WARN(std::string message) {
|
||||||
|
spdlog::warn(message);
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
#define TINYGLTF_NO_EXTERNAL_IMAGE
|
#define TINYGLTF_NO_EXTERNAL_IMAGE
|
||||||
|
|
||||||
#include "../MyGraphicsEngine/Mesh.h"
|
#include "Graphics/Mesh.h"
|
||||||
#include <assimp/Importer.hpp>
|
#include <assimp/Importer.hpp>
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#include <assimp/postprocess.h>
|
#include <assimp/postprocess.h>
|
@ -2,21 +2,19 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
|
|
||||||
#include "Engine.h"
|
#include "Engine.h"
|
||||||
|
#include "glm/glm.hpp"
|
||||||
#include <spdlog/spdlog.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include "../MemoryManager.h"
|
|
||||||
#include <glm/glm.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
#include <MyGraphicsEngine/Shader.h>
|
#include "graphics/Shader.h"
|
||||||
#include <MyGraphicsEngine/Window.h>
|
#include "graphics/Window.h"
|
||||||
#include <MyGraphicsEngine/Camera.h>
|
#include "graphics/Camera.h"
|
||||||
#include <MyGraphicsEngine/Renderable.h>
|
#include "graphics/Renderable.h"
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
|
#include "MemoryManager.h"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -24,5 +22,4 @@ extern "C"
|
|||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
#include "lualib.h"
|
#include "lualib.h"
|
||||||
}
|
}
|
||||||
|
void WARN(std::string message);
|
||||||
*/
|
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
namespace BarinkEngine {
|
namespace BarinkEngine {
|
||||||
|
|
||||||
static class Engine {
|
class Engine {
|
||||||
public:
|
public:
|
||||||
static void Startup();
|
static void Startup();
|
||||||
static void Shutdown();
|
static void Shutdown();
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
static int HeapAllocations = 0;
|
static int HeapAllocations = 0;
|
||||||
static int HeapDeallocations = 0;
|
static int HeapDeallocations = 0;
|
||||||
|
|
||||||
void* operator new(std::size_t sz) {
|
inline void* operator new(std::size_t sz) {
|
||||||
HeapAllocations++;
|
HeapAllocations++;
|
||||||
return std::malloc(sz);
|
return std::malloc(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void* ptr) noexcept {
|
inline void operator delete(void* ptr) noexcept {
|
||||||
HeapDeallocations++;
|
HeapDeallocations++;
|
||||||
std::free(ptr);
|
std::free(ptr);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/MyGraphicsEngine/Buffer.h"
|
#include "Graphics/Buffer.h"
|
||||||
|
|
||||||
|
|
||||||
int Buffer::getBufferID() {
|
int Buffer::getBufferID() {
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/MyGraphicsEngine/Camera.h"
|
#include "Graphics/Camera.h"
|
||||||
|
|
||||||
Camera::Camera(glm::vec3 position, glm::vec3 rotation, float zoom)
|
Camera::Camera(glm::vec3 position, glm::vec3 rotation, float zoom)
|
||||||
: Position(position), Rotation(rotation), Zoom(zoom) {
|
: Position(position), Rotation(rotation), Zoom(zoom) {
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/AssetManager/ModelImporter.h"
|
#include "AssetManager/ModelImporter.h"
|
||||||
|
|
||||||
|
|
||||||
void ModelImporter::ImportFBX(std::string path)
|
void ModelImporter::ImportFBX(std::string path)
|
@ -1,5 +1,7 @@
|
|||||||
#include "include/MyGraphicsEngine/Renderable.h"
|
#include "Graphics/Renderable.h"
|
||||||
#include "include/AssetManager/ModelImporter.h"
|
#include "AssetManager/ModelImporter.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Renderable Renderable::Load()
|
Renderable Renderable::Load()
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/MyGraphicsEngine/Shader.h"
|
#include "Graphics/Shader.h"
|
||||||
|
|
||||||
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/MyGraphicsEngine/VertexArray.h"
|
#include "Graphics/VertexArray.h"
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
|
|
||||||
void VertexArray::Create(){
|
void VertexArray::Create(){
|
@ -1,4 +1,4 @@
|
|||||||
#include "include/MyGraphicsEngine/Window.h"
|
#include "Graphics/Window.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -3,32 +3,56 @@ project "BarinkEngine"
|
|||||||
|
|
||||||
buildmessage "Building BarinkEngine"
|
buildmessage "Building BarinkEngine"
|
||||||
|
|
||||||
includedirs{
|
includedirs {
|
||||||
"./../libs/lua/include",
|
"Include/",
|
||||||
"./libs/spdlog/include",
|
|
||||||
|
|
||||||
"./../libs/glm",
|
"../libs/lua/include",
|
||||||
"./../MyGraphicsEngine/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 {
|
libdirs {
|
||||||
"./../libs/lua",
|
"../libs/lua",
|
||||||
"./../libs/spdlog/build/Release"
|
"../libs/spdlog/build/Release",
|
||||||
|
"../libs/assimp/lib/Debug",
|
||||||
|
"../libs/glfw/build/src/Debug",
|
||||||
|
"../libs/ImGui"
|
||||||
}
|
}
|
||||||
|
|
||||||
links {
|
links {
|
||||||
"lua54",
|
"lua54",
|
||||||
"spdlog",
|
"spdlog",
|
||||||
"MyGraphicsEngine"
|
"assimp-vc143-mtd",
|
||||||
|
"glfw3"
|
||||||
}
|
}
|
||||||
|
|
||||||
files {
|
files {
|
||||||
|
"../libs/ImGui/*.cpp",
|
||||||
|
"../libs/ImGui/backends/imgui_impl_glfw.cpp",
|
||||||
|
"../libs/ImGui/backends/imgui_impl_Opengl3.cpp",
|
||||||
|
"../libs/glad/src/glad.c",
|
||||||
|
|
||||||
"./*.cpp",
|
"./*.cpp",
|
||||||
"./*.h",
|
"./*.h",
|
||||||
"./**/*.cpp",
|
"./**/*.cpp",
|
||||||
"./**/*.h"
|
"./**/*.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
|
||||||
|
@ -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
|
|
@ -1,9 +1,19 @@
|
|||||||
#include <BarinkEngine.h>
|
#include "BarinkEngine.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Start(int argc, char* argv[]) {
|
void Start(int argc, char* argv[]) {
|
||||||
|
|
||||||
std::cout << "Hello start!" << std::endl;
|
std::cout << "Hello start!" << std::endl;
|
||||||
std::cout << "h" << std::endl;
|
std::cout << "h" << std::endl;
|
||||||
|
|
||||||
|
char cwd[256];
|
||||||
|
memset(cwd, '\0', 256);
|
||||||
|
// getcwd(cwd, 256);
|
||||||
|
//spdlog::info("Working directory: {}", cwd);
|
||||||
|
|
||||||
|
WARN("Hello warning");
|
||||||
|
|
||||||
// BarinkWindow GameWindow(800, 600);
|
// BarinkWindow GameWindow(800, 600);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
28
premake5.lua
28
premake5.lua
@ -29,7 +29,29 @@ workspace "BarinkEngine"
|
|||||||
}
|
}
|
||||||
|
|
||||||
includedirs{
|
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 {
|
files {
|
||||||
@ -38,6 +60,4 @@ workspace "BarinkEngine"
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
include("./BarinkEngine")
|
include("./BarinkEngine")
|
||||||
|
|
||||||
include("./MyGraphicsEngine")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user