Compare commits
2 Commits
b2688e843c
...
9a9db279a5
Author | SHA1 | Date | |
---|---|---|---|
9a9db279a5 | |||
210d535c41 |
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
struct EditorContext {
|
||||
std::shared_ptr<Project> CurrentProject;
|
||||
|
||||
Scene MainScene;
|
||||
|
||||
EditorContext() = default;
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include "../../YoggieEngine/src/Scene/Entity.h"
|
||||
#include "Project.h"
|
||||
|
||||
class SceneRuntime : public ApplicationRuntime {
|
||||
class EditorRuntime : public ApplicationRuntime {
|
||||
|
||||
public:
|
||||
SceneRuntime() = default;
|
||||
EditorRuntime() = default;
|
||||
void Start() override
|
||||
{
|
||||
CurrentProject = std::make_shared<Project>("Random");
|
||||
|
@ -42,8 +42,6 @@ void Inspector(entt::entity ent , Scene& scene) {
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
|
||||
|
||||
ImGui::NewLine();
|
||||
|
||||
auto component = entity.GetComponent<IdentifierComponent>();
|
||||
@ -62,6 +60,13 @@ void Inspector(entt::entity ent , Scene& scene) {
|
||||
|
||||
}
|
||||
|
||||
if (entity.HasComponent<Render3DComponent>()) {
|
||||
auto& render3d = entity.GetComponent<Render3DComponent>();
|
||||
if (ImGui::CollapsingHeader("Render3D", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::ColorEdit3("Colour", glm::value_ptr(render3d.color));
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.HasComponent<LightComponent>()) {
|
||||
auto& light = entity.GetComponent<LightComponent>();
|
||||
if (ImGui::CollapsingHeader("Light", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
@ -110,13 +115,8 @@ void SceneExplorer(entt::entity& selected, Scene& scene )
|
||||
|
||||
void Viewport(Framebuffer& framebuffer) {
|
||||
|
||||
unsigned int viewportWindowFlags = ImGuiWindowFlags_NoTitleBar
|
||||
| ImGuiWindowFlags_NoDecoration
|
||||
| ImGuiWindowFlags_NoScrollbar
|
||||
| ImGuiWindowFlags_NoMove
|
||||
| ImGuiWindowFlags_NoCollapse;
|
||||
unsigned int viewportWindowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar ;
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 0,0 });
|
||||
ImGui::Begin("Viewport", false, viewportWindowFlags);
|
||||
ImGui::Image((void*)(intptr_t)framebuffer.GetColourAttachment(), ImVec2{ (float)800,(float)600 });
|
||||
|
||||
@ -138,7 +138,18 @@ void Viewport(Framebuffer& framebuffer) {
|
||||
//ImGuizmo::Manipulate(glm::value_ptr(static_cam), glm::value_ptr(static_projection), ImGuizmo::TRANSLATE, ImGuizmo::WORLD, glm::value_ptr(trans));
|
||||
ImGuizmo::ViewManipulate(glm::value_ptr(cam), 8.0f, ImVec2{ 0.0f,0.0f }, ImVec2{ 128.0f,128.0f }, 0x10101010);
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
}
|
||||
|
||||
void GamePort(Framebuffer& framebuffer)
|
||||
{
|
||||
unsigned int viewportWindowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
|
||||
ImGui::Begin("Game", false, viewportWindowFlags);
|
||||
|
||||
ImGui::Image((void*)(intptr_t)framebuffer.GetColourAttachment(), ImVec2{ (float)800, (float)600 });
|
||||
|
||||
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@ void SceneExplorer(entt::entity& selected, Scene& scene);
|
||||
|
||||
void Viewport(Framebuffer& framebuffer);
|
||||
|
||||
void GamePort(Framebuffer& framebuffer);
|
||||
|
||||
void Settings();
|
||||
|
||||
void Console();
|
||||
|
@ -1,12 +1,13 @@
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <imgui.h>
|
||||
#include <backends/imgui_impl_opengl3.h>
|
||||
#include <backends/imgui_impl_glfw.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <ImGuizmo.h>
|
||||
|
||||
#include <nfd.h>
|
||||
|
||||
#include "../../libs/guizmo/ImGuizmo.h"
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
#include "UI/Widgets.h"
|
||||
#include "Project.h"
|
||||
@ -230,6 +231,7 @@ public:
|
||||
|
||||
//ShowStats();
|
||||
Viewport(*activeRuntime.framebuffer);
|
||||
GamePort(*activeRuntime.framebuffer);
|
||||
SceneExplorer(activeRuntime.Selected, activeRuntime.MainScene);
|
||||
Inspector(activeRuntime.Selected, activeRuntime.MainScene);
|
||||
|
||||
@ -245,7 +247,7 @@ public:
|
||||
|
||||
private:
|
||||
EditorContext context;
|
||||
SceneRuntime activeRuntime ;
|
||||
EditorRuntime activeRuntime ;
|
||||
char* path = nullptr;
|
||||
char* savePath = nullptr;
|
||||
char* scenePath = nullptr;
|
||||
|
@ -1,11 +1,6 @@
|
||||
#pragma once
|
||||
#include "YoggieEngine.h"
|
||||
|
||||
#include "Input/InputManager.h"
|
||||
#include "Graphics/Renderer.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
namespace YoggieEngine {
|
||||
// forward declaration
|
||||
class InputManager;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "ModelImporter.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
||||
SceneObject* ModelImporter::Import(const std::string path)
|
||||
|
@ -1,7 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
||||
struct Event
|
||||
|
@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.h"
|
||||
#include "EventListener.h"
|
||||
namespace YoggieEngine{
|
||||
class EventEmitter {
|
||||
public:
|
||||
|
@ -1,8 +1,4 @@
|
||||
#pragma once
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "Event.h"
|
||||
namespace YoggieEngine {
|
||||
class EventListener {
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
#include <glad/glad.h>
|
||||
|
||||
namespace YoggieEngine {
|
||||
class Buffer {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "Framebuffer.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace YoggieEngine {
|
||||
Framebuffer::Framebuffer()
|
||||
{
|
||||
|
@ -1,7 +1,4 @@
|
||||
#pragma once
|
||||
#include <glad/glad.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace YoggieEngine {
|
||||
class Framebuffer {
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "UniformBuffer.h"
|
||||
#include <glad/glad.h>
|
||||
|
||||
namespace YoggieEngine {
|
||||
UniformBuffer::UniformBuffer(unsigned int size)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "VertexArray.h"
|
||||
#include <glad/glad.h>
|
||||
namespace YoggieEngine {
|
||||
void VertexArray::Create() {
|
||||
glGenVertexArrays(1, &id);
|
||||
|
@ -1,8 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
namespace YoggieEngine {
|
||||
class Camera {
|
||||
public:
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <glm/glm.hpp>
|
||||
#include <string>
|
||||
#include "Shader.h"
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
#include "Vertex.h"
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "Shader.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
namespace YoggieEngine {
|
||||
Shader::Shader(const std::string vertexShaderPath, const std::string fragmentShaderPath)
|
||||
{
|
||||
|
@ -1,10 +1,4 @@
|
||||
#pragma once
|
||||
#include <glad/glad.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
namespace YoggieEngine {
|
||||
class Shader {
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "Texture.h"
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "../stb_image.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace YoggieEngine {
|
||||
Texture::Texture(const std::string texturePath) {
|
||||
|
@ -1,7 +1,4 @@
|
||||
#pragma once
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <string>
|
||||
|
||||
namespace YoggieEngine {
|
||||
class Texture {
|
||||
public:
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace YoggieEngine {
|
||||
struct Vertex {
|
||||
glm::vec3 vertices;
|
||||
|
@ -4,8 +4,6 @@ namespace YoggieEngine {
|
||||
RenderSurface::RenderSurface() {
|
||||
shader = new Shader("build/SandboxAppliction/Debug/renderSuface.vs", "build/SandboxApplication/Debug/renderSurface.fs");
|
||||
|
||||
|
||||
|
||||
verts = std::vector<glm::vec3>{
|
||||
{-0.5f, 0.5f, 0.0f}, // 0
|
||||
{-0.5f, -0.5f, 0.0f}, // 1
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
#include "../Graphics/Memory/Buffer.h"
|
||||
#include "../Graphics/Memory/VertexArray.h"
|
||||
#include <vector>
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
#pragma once
|
||||
#include "Primitives/Mesh.h"
|
||||
#include "Primitives/Material.h"
|
||||
#include "Primitives/Texture.h"
|
||||
#include "../Scene/Scene.h"
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
||||
struct Renderable {
|
||||
|
@ -3,8 +3,6 @@
|
||||
#include "../Scene/Components.h"
|
||||
#include "../Graphics/Memory/VertexArray.h"
|
||||
#include "../Graphics/Memory/Buffer.h"
|
||||
#include <glad/glad.h>
|
||||
#include <glm/gtc/type_precision.hpp>
|
||||
|
||||
namespace YoggieEngine {
|
||||
float Angle = 0.0;
|
||||
|
@ -1,16 +1,12 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include "glad/glad.h"
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
#include "../PerfCounter.h"
|
||||
|
||||
#include "Primitives/Camera.h"
|
||||
#include "Renderable.h"
|
||||
#include "Memory/Framebuffer.h"
|
||||
#include "../Scene/Components.h"
|
||||
#include"../Scene/Scene.h"
|
||||
|
||||
namespace YoggieEngine {
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <YoggieEngine.h>
|
||||
#include "PerfCounter.h"
|
||||
#include <imgui.h>
|
||||
#include <iostream>
|
||||
|
||||
namespace YoggieEngine {
|
||||
uint64_t EngineInstrumentation::GetPrecisionTime() {
|
||||
using namespace std::chrono; // REMINDER: This is kinda ugly but safes line width
|
||||
|
@ -1,10 +1,5 @@
|
||||
#pragma once
|
||||
#include "YoggieEngine.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
|
||||
namespace YoggieEngine {
|
||||
struct EngineStatistics {
|
||||
float frameTime;
|
||||
|
@ -38,7 +38,7 @@ namespace YoggieEngine {
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
|
||||
printf("Failed to initialize GLAD!\n");
|
||||
spdlog::error("Failed to initialize GLAD!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#define GLFW_STATIC
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include "../EventSystem/Event.h"
|
||||
#include "../EventSystem/EventListener.h"
|
||||
|
@ -1,8 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include "../Graphics/Primitives/Shader.h"
|
||||
#include "../Graphics/Primitives/Mesh.h"
|
||||
namespace YoggieEngine {
|
||||
struct IdentifierComponent {
|
||||
std::string name;
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
namespace YoggieEngine {
|
||||
class Scene;
|
||||
class Entity {
|
||||
|
@ -1,7 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <entt/entt.hpp>
|
||||
namespace YoggieEngine {
|
||||
class Entity;
|
||||
class Scene
|
||||
|
@ -1,7 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace YoggieEngine {
|
||||
class Node {
|
||||
public:
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../Graphics/Primitives/Camera.h"
|
||||
#include "../../Graphics/Renderable.h"
|
||||
#include "Node.h"
|
||||
|
||||
|
@ -1,15 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
|
||||
#include "LuaScriptingManager.h"
|
||||
|
||||
|
||||
|
@ -1,15 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
|
||||
#include "LuaScript.h"
|
||||
|
||||
/*
|
||||
|
@ -1,17 +1,42 @@
|
||||
#pragma once
|
||||
#include <glad/glad.h>
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
// Important STL
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
|
||||
// Important libraries
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <glad/glad.h>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <imgui.h>
|
||||
#include <entt/entt.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
|
||||
// Main library stuff
|
||||
#include "Platform/Window.h"
|
||||
|
||||
#include "Graphics/Primitives/Mesh.h"
|
||||
#include "Graphics/Primitives/Shader.h"
|
||||
#include "Graphics/Primitives/Texture.h"
|
||||
#include "Graphics/Primitives/Camera.h"
|
||||
#include "Graphics/Primitives/Material.h"
|
||||
#include "Graphics/Renderer.h"
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include "EventSystem/EventEmitter.h"
|
||||
#include "EventSystem/EventListener.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user