Compare commits

...

2 Commits

Author SHA1 Message Date
b03b82272f Moving to a single renderer instance system 2022-10-08 15:34:02 +02:00
3974889f7e More config and testing adding models
Seperated Sanbox premake config from the main premake file.
2022-08-15 21:35:22 +02:00
29 changed files with 9028 additions and 8962 deletions

View File

@ -12,6 +12,7 @@
#include <string>
#include "Scene/SceneNodeTypes.h"
void ProcessVertices(aiMesh* mesh, std::vector<BarinkEngine::Vertex>& out_vertices);
void ProcessIndices(aiMesh* mesh, std::vector<unsigned int>& out_indices);
@ -20,7 +21,7 @@ namespace BarinkEngine {
public:
SceneObject* Import(const std::string path);
BarinkEngine::SceneObject* Import(const std::string path);
private:

View File

@ -5,6 +5,7 @@
#include "graphics/Texture.h"
#include "graphics/Camera.h"
#include "graphics/Renderable.h"
#include "Graphics/Renderer.h"
#include "Graphics/Material.h"
#include "spdlog/spdlog.h"

View File

@ -1,5 +1,5 @@
#pragma once
#include <string>
#include <string>
struct Event
{

View File

@ -0,0 +1,30 @@
#pragma once
#include "VertexArray.h"
#include "Buffer.h"
#include "Mesh.h"
#include "Material.h"
namespace BarinkEngine {
class GPU_Bucket {
public:
GPU_Bucket();
~GPU_Bucket();
void Upload(const Mesh& renderable);
GpuBuffer vertexBuffer;
GpuBuffer elementBuffer;
VertexArray vertexarray;
const Mesh* mesh;
const Material* material;
private :
unsigned int uv_id;
};
};

View File

@ -7,7 +7,7 @@ class Material {
public:
Material(const Shader& shader);
void Apply();
void Apply()const;
glm::vec3 Color;

View File

@ -1,26 +1,12 @@
#pragma once
#include <vector>
#include <glm/glm.hpp>
#include "VertexArray.h"
#include "Buffer.h"
#include "Vertex.h"
namespace BarinkEngine{
struct Vertex {
glm::vec3 vertices;
glm::vec2 uv;
};
class Mesh {
public:
namespace BarinkEngine {
struct Mesh {
std::vector<Vertex> vertices;
std::vector<unsigned int> elements;
private:
GpuBuffer vertexBuffer;
GpuBuffer elementBuffer;
VertexArray VAO;
unsigned int UV_id;
};
}
}

View File

@ -1,23 +1,14 @@
#pragma once
#include <vector>
#include "Mesh.h"
#include "Material.h"
#include "Texture.h"
#include "Scene.h"
namespace BarinkEngine {
class Renderable {
public:
Mesh mesh;
struct Renderable {
BarinkEngine::Mesh* mesh;
Material* material;
Texture* texture;
Shader* shader;
Renderable();
~Renderable();
};
}

View File

@ -1,8 +1,16 @@
#pragma once
#include "Graphics/Renderable.h"
#include <vector>
#include <glm/gtc/matrix_transform.hpp>
#include "glad/glad.h"
#include "GLFW/glfw3.h"
#include "PerfCounter.h"
#include "Graphics/Camera.h"
#include "Graphics/Renderable.h"
#include "Graphics/GPUBucket.h"
namespace BarinkEngine {
class Renderer {
@ -15,7 +23,7 @@ namespace BarinkEngine {
void Submit(Renderable* model);
private:
std::vector<Renderable*> models;
std::vector<GPU_Bucket*> models;
};
}

View File

@ -14,7 +14,7 @@ class Shader {
char* readFile (const char* filePath);
public:
Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath);
void Use();
void Use() const;
void setUniformMat4(std::string uniformName, glm::mat4 matrix4)const;
void setUniformVec4(std::string uniformName, glm::vec4 vector4)const;
void setUniformVec3(std::string uniformName, glm::vec3 vector3)const;

View File

@ -0,0 +1,9 @@
#pragma once
#include <glm/glm.hpp>
namespace BarinkEngine {
struct Vertex {
glm::vec3 vertices;
glm::vec2 uv;
};
}

View File

@ -0,0 +1,37 @@
#include "Graphics/GPUBucket.h"
BarinkEngine::GPU_Bucket::GPU_Bucket() {
}
BarinkEngine::GPU_Bucket::~GPU_Bucket() {
}
void BarinkEngine::GPU_Bucket::Upload(const Mesh& renderable) {
// keep a ref to the origin in main memory
mesh = &renderable;
// Upload gpu
vertexarray.Create();
vertexarray.Bind();
vertexBuffer.createBuffer();
vertexBuffer.Bind(false);
vertexBuffer.setBufferData((void*)&renderable.vertices[0], renderable.vertices.size() * sizeof(BarinkEngine::Vertex), false);
if (renderable.elements.empty() == false) {
elementBuffer.createBuffer();
elementBuffer.Bind(true);
elementBuffer.setBufferData((void*)&renderable.elements[0], renderable.elements.size() * sizeof(unsigned int), true);
}
vertexarray.AttachAttribute(0, 3, sizeof(Vertex));
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(BarinkEngine::Vertex), (void*)offsetof(BarinkEngine::Vertex, vertices));
glEnableVertexAttribArray(1);
vertexBuffer.Unbind(false);
vertexarray.Unbind();
}

View File

@ -4,7 +4,8 @@ Material::Material(const Shader& shader) :
shader(shader) {
}
void Material::Apply() const {
void Material::Apply() {
shader.Use();
shader.setUniformVec3("Color", Color);
}

View File

@ -1,9 +1,8 @@
#include "AssetManager/ModelImporter.h"
#include "spdlog/spdlog.h"
BarinkEngine::SceneObject* BarinkEngine::ModelImporter::Import(const std::string path)
{
SceneObject* root = new SceneObject(std::string(path), nullptr);
Assimp::Importer importer;
@ -12,9 +11,15 @@ BarinkEngine::SceneObject* BarinkEngine::ModelImporter::Import(const std::string
aiNode* currentNode = scene->mRootNode;
std::vector<BarinkEngine::Mesh> meshes = processNode(currentNode, scene);
std::cout << "[DEBUG]: Loaded "<< meshes.size() << " meshes!" << std::endl;
// create a renderable (per mesh ?? )
root->renderable = new Renderable();
root->renderable->mesh = &(meshes[0]);
return root;
return root;
}

View File

@ -1,53 +0,0 @@
#include "Graphics/Renderable.h"
#include "AssetManager/ModelImporter.h"
#include "PerfCounter.h"
BarinkEngine::Renderable::Renderable()
{
/*
VAO.Create();
VAO.Bind();
vertexBuffer.createBuffer();
vertexBuffer.Bind(false);
vertexBuffer.setBufferData(&meshes[0].vertices[0], meshes[0].vertices.size() * sizeof(BarinkEngine::Vertex), false);
elementBuffer.createBuffer();
elementBuffer.Bind(true);
elementBuffer.setBufferData(&meshes[0].elements[0], meshes[0].elements.size() * sizeof(unsigned int), true);
VAO.AttachAttribute(0, 3, sizeof(BarinkEngine::Vertex));
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(BarinkEngine::Vertex),(void* )offsetof(BarinkEngine::Vertex, vertices));
glEnableVertexAttribArray(1);
//vertexBuffer.Unbind(false);
VAO.Unbind();
*/
}
BarinkEngine::Renderable::~Renderable()
{
// glDeleteBuffers(1, &UV_id);
}
// Draw call Example !!
/*
VAO.Bind();
elementBuffer.Bind(true);
glActiveTexture(GL_TEXTURE0);
glUniform1i(glGetUniformLocation(shader->id, "Texture"), GL_TEXTURE0);
texture->Bind();
ES->verts = meshes[0].vertices.size();
ES->DC++;
glDrawElements(GL_TRIANGLES, static_cast<unsigned int>(meshes[0].elements.size()), GL_UNSIGNED_INT, NULL);
VAO.Unbind();
*/

View File

@ -1,25 +1,77 @@
#include "Graphics/Renderer.h"
BarinkEngine::Renderer::Renderer()
{
models = std::vector<Renderable*>();
models = std::vector<GPU_Bucket*>();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
BarinkEngine::Renderer::~Renderer()
{
// CleanUp!
// For each model submitted
for ( auto packet : models )
{
delete packet;
}
// glDeleteBuffers(1, &UV_id);
}
void BarinkEngine::Renderer::Render()
{
// This creation of the projection and camera is somewhat wastefull
Camera cam = Camera(glm::vec3(0.0f, 1.5f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), 90.0f);
glm::mat4 projection = glm::perspective(glm::radians(cam.Zoom), (800.0f / 600.0f), 0.001f, 100.0f);
for (auto model : models) {
//model->Draw();
// Push matrices etc ....
model->vertexarray.Bind();
model->elementBuffer.Bind(true);
if (model->material == nullptr) {
std::cout << "No material attached!" << std::endl;
}
else {
model->material->Apply();
}
// Update perf counters
ES->verts = model->mesh->vertices.size();
ES->DC++;
glDrawElements( GL_TRIANGLES,
static_cast<unsigned int>(model->mesh->elements.size()),
GL_UNSIGNED_INT,
NULL
);
model->vertexarray.Unbind();
}
}
// Upload data to cpu and add object to render list
void BarinkEngine::Renderer::Submit(Renderable* model)
{
models.push_back(model);
// Upload mesh data to gpu for render
GPU_Bucket* bucket = new GPU_Bucket();
bucket->material = model->material;
bucket->Upload(*model->mesh);
models.push_back(bucket); // Maybe push a GPU packet or something instead
}

View File

@ -1,5 +1,6 @@
#include "Graphics/Shader.h"
#include "spdlog/spdlog.h"
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
{
char infoLog[512];
@ -57,8 +58,12 @@ Shader::Shader(const std::string vertexShaderPath, const std::string fragmentSha
}
char* Shader::readFile (const char* filePath){
spdlog::info("Opening {} ", filePath);
std::ifstream file ;
file.open(filePath);
@ -90,7 +95,7 @@ char* Shader::readFile (const char* filePath){
return FileBuffer;
}
void Shader::Use()
void Shader::Use() const
{
glUseProgram(id);
}

View File

@ -16,6 +16,15 @@ Width(width), Height(height), FullScreen(false){
exit(-1);
}
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE);
glfwWindowHint(GLFW_FOCUS_ON_SHOW, GLFW_TRUE);
// No window decorations such as a border, a close widget
//glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
//glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
// Disable resizing the window
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
window = glfwCreateWindow(Width, Height, "BarinkEngine", NULL, NULL);
if( !window)

View File

@ -1,9 +1,9 @@
#pragma once
#include "imgui.h"
#include <BarinkEngine.h>
void CameraTool(Camera* camera);
void ScriptingTool(char* code);
void transformWindow(Transform& transform, std::string PanelName);
void materialWindow(Material& material, std::string PanelName);
void SceneExplorer(Scene& scene, std::string PanelName);
#pragma once
#include "imgui.h"
#include <BarinkEngine.h>
void CameraTool(Camera* camera);
void ScriptingTool(char* code);
void transformWindow(Transform& transform, std::string PanelName);
void materialWindow(Material& material, std::string PanelName);
void SceneExplorer(Scene& scene, std::string PanelName);

View File

@ -1,12 +1,12 @@
# Blender 3.1.2 MTL File: 'None'
# www.blender.org
newmtl Material
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
# Blender 3.1.2 MTL File: 'None'
# www.blender.org
newmtl Material
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2

View File

@ -1,40 +1,40 @@
# Blender 3.1.2
# www.blender.org
mtllib Cube.mtl
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.875000 0.500000
vt 0.625000 0.250000
vt 0.125000 0.500000
vt 0.375000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
vt 0.625000 0.000000
vt 0.375000 1.000000
vt 0.375000 0.000000
vt 0.125000 0.750000
s 0
usemtl Material
f 1/1/1 5/5/1 7/9/1 3/3/1
f 4/4/2 3/3/2 7/10/2 8/12/2
f 8/13/3 7/11/3 5/6/3 6/8/3
f 6/7/4 2/2/4 4/4/4 8/14/4
f 2/2/5 1/1/5 3/3/5 4/4/5
f 6/8/6 5/6/6 1/1/6 2/2/6
# Blender 3.1.2
# www.blender.org
mtllib Cube.mtl
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.875000 0.500000
vt 0.625000 0.250000
vt 0.125000 0.500000
vt 0.375000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
vt 0.625000 0.000000
vt 0.375000 1.000000
vt 0.375000 0.000000
vt 0.125000 0.750000
s 0
usemtl Material
f 1/1/1 5/5/1 7/9/1 3/3/1
f 4/4/2 3/3/2 7/10/2 8/12/2
f 8/13/3 7/11/3 5/6/3 6/8/3
f 6/7/4 2/2/4 4/4/4 8/14/4
f 2/2/5 1/1/5 3/3/5 4/4/5
f 6/8/6 5/6/6 1/1/6 2/2/6

View File

@ -0,0 +1,40 @@
project "SandboxApplication"
kind "ConsoleApp"
buildmessage "Building Sandbox ..."
links{
"BarinkEngine"
}
includedirs{
"./../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",
"./include"
}
libdirs {
'./../build/BarinkEngine/Debug'
}
files {
"./include/*.h",
"./src/*.cpp"
}

View File

@ -1,71 +1,71 @@
#include "GUI.h"
void SceneExplorer(Scene& scene, std::string PanelName) {
if (ImGui::Begin(PanelName.c_str())) {
ImGui::ListBoxHeader("##ObjectList");
Node& current = scene.GetRoot();
Node* next = &current;
// Show first node
ImGui::Selectable(next->name.c_str(), true);
ImGui::Indent();
if (next->children.size() != 0) {
for (auto child : next->children)
{
std::string& name = child->name;
ImGui::Selectable(name.c_str(), false);
}
}
ImGui::ListBoxFooter();
}
ImGui::End();
}
void CameraTool(Camera* cam) {
ImGui::Begin("Camera");
ImGui::SliderFloat("Zoom:", &cam->Zoom, 10, 190);
ImGui::InputFloat3("Position:", &cam->Position[0]);
ImGui::InputFloat3("Rotation:", &cam->Rotation[0]);
ImGui::End();
}
void ScriptingTool(char* code) {
ImGui::Begin("Scripting");
ImGui::InputTextMultiline("Lua Script", code, 255);
bool runCode = ImGui::Button("Run");
ImGui::End();
}
void transformWindow(Transform& transform, std::string PanelName) {
ImGui::Begin(PanelName.c_str());
ImGui::InputFloat3("Position:", (float*)&transform.Position[0]);
ImGui::InputFloat3("Rotation:", (float*)&transform.Rotation[0]);
ImGui::InputFloat3("Scale:", (float*)&transform.Scale[0]);
ImGui::End();
}
void materialWindow(Material& material, std::string PanelName) {
ImGui::Begin(PanelName.c_str());
ImGui::ColorPicker3("Color:", &material.Color[0]);
ImGui::End();
#include "GUI.h"
void SceneExplorer(Scene& scene, std::string PanelName) {
if (ImGui::Begin(PanelName.c_str())) {
ImGui::ListBoxHeader("##ObjectList");
Node& current = scene.GetRoot();
Node* next = &current;
// Show first node
ImGui::Selectable(next->name.c_str(), true);
ImGui::Indent();
if (next->children.size() != 0) {
for (auto child : next->children)
{
std::string& name = child->name;
ImGui::Selectable(name.c_str(), false);
}
}
ImGui::ListBoxFooter();
}
ImGui::End();
}
void CameraTool(Camera* cam) {
ImGui::Begin("Camera");
ImGui::SliderFloat("Zoom:", &cam->Zoom, 10, 190);
ImGui::InputFloat3("Position:", &cam->Position[0]);
ImGui::InputFloat3("Rotation:", &cam->Rotation[0]);
ImGui::End();
}
void ScriptingTool(char* code) {
ImGui::Begin("Scripting");
ImGui::InputTextMultiline("Lua Script", code, 255);
bool runCode = ImGui::Button("Run");
ImGui::End();
}
void transformWindow(Transform& transform, std::string PanelName) {
ImGui::Begin(PanelName.c_str());
ImGui::InputFloat3("Position:", (float*)&transform.Position[0]);
ImGui::InputFloat3("Rotation:", (float*)&transform.Rotation[0]);
ImGui::InputFloat3("Scale:", (float*)&transform.Scale[0]);
ImGui::End();
}
void materialWindow(Material& material, std::string PanelName) {
ImGui::Begin(PanelName.c_str());
ImGui::ColorPicker3("Color:", &material.Color[0]);
ImGui::End();
}

View File

@ -1,119 +1,102 @@
#include "BarinkEngine.h"
#include "Scene\SceneManager.h"
#include "Scene\SceneNodeTypes.h"
#include "AssetManager/ModelImporter.h"
#include "imgui.h"
#include "GUI.h"
#include "Util.h"
/*
* Define globals
*/
Camera* cam;
Shader* shader;
char* code = new char[254];
const std::string vertexShaderSource = "build/SandboxApplication/Debug/test.vs";
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
*/
void Start() {
// Build a basic test scene
// NOTE: This will later be done through an editor
// Create a level and load it as the current level
std::string levelName("Test Level");
Level1 = SceneManager::CreateScene(levelName);
SceneManager::LoadScene(*Level1);
// Create a cube node
// Load a model
//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);
std::string group2Name("Nested-Group2");
auto testGroup2 = new Group(group2Name);
Level1->GetRoot().addChild(*testGroup2);
// Walk scene graph
PrintSceneTree(Level1->GetRoot(),0);
shader = new Shader(vertexShaderSource, fragmentShaderSource);
cam = new Camera(glm::vec3(0.0f, 1.5f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), 90.0f);
memset(code, '\0', 254);
}
/*
* Runs every frame
* - Use to draw Immediate mode graphics (Not meant for HUD's )
*/
void ImmediateGraphicsDraw() {
ImGui::NewFrame();
// Show ImGui demo such that I can easily look
// at possible GUI elements to use
ImGui::ShowDemoWindow();
// Show internal BarinkEngine stats
ShowStats();
// Show different tooling for this specific sandbox
CameraTool(cam);
ScriptingTool(code);
SceneExplorer(*Level1, "Scene Explorer");
}
/*
* Runs every frame
* - Meant for game logic ( non-physics related)
*/
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);
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("V", cam->GetViewMatrix());
//cube->renderable->material->Apply();
//Cube->Draw();
}
/*
* Runs at the end of the program
* - Meant for cleanup
*/
void Stop() {
delete MI;
delete shader;
#include "BarinkEngine.h"
#include "Scene\SceneManager.h"
#include "Scene\SceneNodeTypes.h"
#include "AssetManager/ModelImporter.h"
#include "imgui.h"
#include "GUI.h"
#include "Util.h"
/*
* Define globals
*/
Shader* shader;
char* code = new char[254];
const std::string vertexShaderSource = "../build/SandboxApplication/Debug/test.vs";
const std::string fragmentShaderSource = "../build/SandboxApplication/Debug/test.fs";
BarinkEngine::ModelImporter* MI = new BarinkEngine::ModelImporter();
Scene* Level1;
BarinkEngine::Renderer* renderer;
BarinkEngine::SceneObject* cube;
/*
* Runs once at startup
* - USe to initialize the game/sandbox/demo
*/
void Start() {
// Build a basic test scene
// NOTE: This will later be done through an editor
// Create a level and load it as the current level
std::string levelName("Test Level");
Level1 = SceneManager::CreateScene(levelName);
SceneManager::LoadScene(*Level1);
shader = new Shader(vertexShaderSource, fragmentShaderSource);
// Create a cube node
cube = MI->Import("../build/SandboxApplication/Debug/Models/Cube.obj");
cube->renderable->material = new Material(*shader);
// What is in cube now ??
std::cout << "mesh vertices: " << cube->renderable->mesh->vertices.size() << std::endl;
std::cout << "mesh elements: " << cube->renderable->mesh->elements.size() << std::endl;
Level1->GetRoot().addChild(*cube);
memset(code, '\0', 254);
// TODO: Move to runtime/ Engine
renderer = new BarinkEngine::Renderer();
// NOTE: Submits should later be done through walking the sceneTree
renderer->Submit(cube->renderable);
}
/*
* Runs every frame
* - Use to draw Immediate mode graphics (Not meant for HUD's )
*/
void ImmediateGraphicsDraw() {
ImGui::NewFrame();
// Show ImGui demo such that I can easily look
// at possible GUI elements to use
ImGui::ShowDemoWindow();
// Show internal BarinkEngine stats
ShowStats();
// Show different tooling for this specific sandbox
// CameraTool(cam);
ScriptingTool(code);
SceneExplorer(*Level1, "Scene Explorer");
}
/*
* Runs every frame
* - Meant for game logic ( non-physics related)
*/
void Update()
{
renderer->Render();
}
/*
* Runs at the end of the program
* - Meant for cleanup
*/
void Stop() {
delete MI;
delete renderer;
delete shader;
}

View File

@ -11,7 +11,7 @@
<input type="checkbox"></input> Basic Textures \
<input type="checkbox" checked></input> Link GLEW or GLAD \
<input type="checkbox" checked></input> Work on basic logging \
<input type="checkbox"></input> Input handling \
<input type="checkbox" checked></input> Input handling \
<input type="checkbox"></input> More shader work \
<input type="checkbox" checked></input> Load FBX model files \
<input type="checkbox"></input> Basic Physics \
@ -21,5 +21,6 @@
## Resources
https://renderdoc.org/
https://api.projectchrono.org/tutorial_table_of_content_chrono.html
https://renderdoc.org/ \
https://api.projectchrono.org/tutorial_table_of_content_chrono.html \
https://github.com/epezent/implot -- Useful when displaying graphs of any kind \

View File

@ -18,46 +18,6 @@ workspace "BarinkEngine"
defines {"NDEBUG"}
optimize "On"
project "SandboxApplication"
kind "ConsoleApp"
buildmessage "Building Sandbox ..."
links{
"BarinkEngine"
}
includedirs{
"./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 {
"./SandboxApplication/*.h",
"./SandboxApplication/*.cpp"
}
include("./SandboxApplication")
include("./BarinkEngine")