Compare commits

..

3 Commits

Author SHA1 Message Date
ab5599f1fc Started development of BECS - the basic ECS system for the engine 2022-08-06 18:24:05 +02:00
3639f967e1 Ignore untracked file changes in some submodules
These files are probably nothing of great importance to our
development and thus have no business showing up in our git status
2022-08-06 18:22:10 +02:00
5a06b068f3 Moving source files to a src folder 2022-08-06 18:21:42 +02:00
33 changed files with 636 additions and 585 deletions

3
.gitmodules vendored
View File

@ -4,12 +4,14 @@
[submodule "glm"] [submodule "glm"]
path = libs/glm path = libs/glm
url = https://github.com/nigelbarink/glm.git url = https://github.com/nigelbarink/glm.git
ignore = untracked
[submodule "spdlog"] [submodule "spdlog"]
path = libs/spdlog path = libs/spdlog
url = https://github.com/nigelbarink/spdlog.git url = https://github.com/nigelbarink/spdlog.git
[submodule "tinygltf"] [submodule "tinygltf"]
path = libs/tinygltf path = libs/tinygltf
url = https://github.com/syoyo/tinygltf.git url = https://github.com/syoyo/tinygltf.git
ignore = untracked
[submodule "GorrillaAudio"] [submodule "GorrillaAudio"]
path = libs/GorillaAudio path = libs/GorillaAudio
url = https://github.com/mewspring/gorilla-audio.git url = https://github.com/mewspring/gorilla-audio.git
@ -22,6 +24,7 @@
[submodule "libs/steam-audio"] [submodule "libs/steam-audio"]
path = libs/steam-audio path = libs/steam-audio
url = https://github.com/ValveSoftware/steam-audio.git url = https://github.com/ValveSoftware/steam-audio.git
ignore = untracked
[submodule "libs/physx"] [submodule "libs/physx"]
path = libs/physx path = libs/physx
url = https://git.barink.dev/Nigel/PhysX.git url = https://git.barink.dev/Nigel/PhysX.git

View File

@ -0,0 +1,7 @@
#pragma once
namespace BECS {
struct Component {
};
}

View File

@ -0,0 +1,13 @@
#pragma once
#include <vector>
#include "Component.h"
namespace BECS {
typedef unsigned long int Entity;
}

View File

@ -0,0 +1,7 @@
#pragma once
namespace BECS {
struct System {
};
}

View File

@ -0,0 +1,17 @@
#pragma once
#include "System.h"
#include <vector>
#include "Component.h"
#include "Entity.h"
namespace BECS {
struct World {
private:
std::vector<System> systems;
std::vector<Component> components;
std::vector<Entity> entities;
};
}

View File

@ -3,12 +3,13 @@
#include "Scene/SceneNodeTypes.h" #include "Scene/SceneNodeTypes.h"
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "../../src/Scene/SceneNodeTypes.cpp"
/* /*
* Define a helper class to more easily build a proper scene * Define a helper class to more easily build a proper scene
*/ */
static class SceneBuilder { static class SceneBuilder {
static Group* AddGroup(std::string name); static Group* AddGroup(std::string name);
static SceneObject* AddVisual(std::string name, Renderable& object, glm::vec3 position ); static BarinkEngine::SceneObject* AddVisual(std::string name, BarinkEngine::Renderable& object, glm::vec3 position );
}; };

View File

@ -52,10 +52,10 @@ project "BarinkEngine"
files { files {
"../libs/glad/src/glad.c", "../libs/glad/src/glad.c",
"./*.cpp", "./src/*.cpp",
"./*.h", "./Include/*.h",
"./**/*.cpp", "./src/**/*.cpp",
"./**/*.h" "./Include/**/*.h"
} }

View File

@ -1,30 +1,33 @@
#include "GUI.h" #include "GUI.h"
void SceneExplorer(Scene& scene, std::string PanelName) { void SceneExplorer(Scene& scene, std::string PanelName) {
ImGui::Begin(PanelName.c_str()); if (ImGui::Begin(PanelName.c_str())) {
ImGui::ListBoxHeader("##ObjectList");
ImGui::ListBoxHeader("##ObjectList"); Node& current = scene.GetRoot();
Node& current = scene.GetRoot(); Node* next = &current;
Node* next = &current; // Show first node
ImGui::Selectable(next->name.c_str(), true);
// Show first node ImGui::Indent();
ImGui::Selectable(next->name.c_str(), true);
ImGui::Indent(); if (next->children.size() != 0) {
for (auto child : next->children)
if (next->children.size() != 0) { {
for (auto child : next->children) std::string& name = child->name;
{ ImGui::Selectable(name.c_str(), false);
std::string& name = child->name; }
ImGui::Selectable(name.c_str(), false);
} }
ImGui::ListBoxFooter();
} }
ImGui::ListBoxFooter();
ImGui::End(); ImGui::End();
} }
void CameraTool(Camera* cam) { void CameraTool(Camera* cam) {