adding materials, adding serialization for meshes and materials, random fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef EDITOR_HPP
|
||||
#define EDITOR_HPP
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <open_engine.hpp>
|
||||
|
||||
#include "open_engine/renderer/renderer3d.hpp"
|
||||
@@ -92,9 +91,11 @@ namespace OpenEngine {
|
||||
|
||||
editor_camera = EditorCamera(30.0f, 1920.0f/1080.0f, 0.1f, 1000.0f);
|
||||
|
||||
// TODO: Add license
|
||||
icons["play"] = Texture2D::Create("resources/textures/icons/play.png");
|
||||
icons["stop"] = Texture2D::Create("resources/textures/icons/stop.png");
|
||||
|
||||
// =============================================
|
||||
Entity cube = scene->CreateEntity("cube");
|
||||
|
||||
|
||||
@@ -104,6 +105,7 @@ namespace OpenEngine {
|
||||
|
||||
cube.AddComponent<MeshComponent>(mesh);
|
||||
|
||||
// =============================================
|
||||
Entity quad = scene->CreateEntity("quad");
|
||||
quad.AddComponent<TransformComponent>();
|
||||
quad.GetComponents<TransformComponent>().translation = {0, 0, 0};
|
||||
@@ -112,6 +114,7 @@ namespace OpenEngine {
|
||||
|
||||
quad.AddComponent<MeshComponent>(quad_mesh);
|
||||
|
||||
// =============================================
|
||||
Entity cube2 = scene->CreateEntity("cube2");
|
||||
cube2.AddComponent<TransformComponent>();
|
||||
cube2.GetComponents<TransformComponent>().translation = {2, 0, 0};
|
||||
@@ -129,7 +132,6 @@ namespace OpenEngine {
|
||||
}
|
||||
*/
|
||||
|
||||
// TODO: Add file texture. Get free icons and add license
|
||||
//icons["folder"] = Texture2D::Create("resources/textures/icons/folder.png");
|
||||
/*
|
||||
for (float i = 0; i < 200; i++) {
|
||||
@@ -352,7 +354,7 @@ namespace OpenEngine {
|
||||
bool was_focused = viewport_focused;
|
||||
viewport_focused = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow);
|
||||
viewport_hovered = ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow);
|
||||
Application::Get().GetImGuiLayer()->SetBlockEvents((!viewport_focused && !viewport_hovered) || ImGui::IsAnyItemActive());
|
||||
Application::Get().GetImGuiLayer()->SetBlockEvents(ImGui::IsAnyItemActive());
|
||||
|
||||
if (viewport_focused && !was_focused)
|
||||
editor_camera.ResetMousePosition();
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace OpenEngine {
|
||||
void SpriteOnImGuiRender(entt::registry& registry, entt::entity entity);
|
||||
void CameraOnImGuiRender(entt::registry& registry, entt::entity entity);
|
||||
void MeshOnImGuiRender(entt::registry®istry, entt::entity entity);
|
||||
void MaterialOnImGuiRender(entt::registry& registry, entt::entity entity);
|
||||
}
|
||||
|
||||
#endif // EDITOR_COMPONENT_HPP
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace OpenEngine {
|
||||
private:
|
||||
std::filesystem::path current_directory;
|
||||
Ref<Texture2D> folder_icon;
|
||||
Ref<Texture2D> file_icon;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user