Editor Asset explorer setup
This commit is contained in:
parent
c57177a1a9
commit
f7a85d53ab
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,2 +1,3 @@
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.webp filter=lfs diff=lfs merge=lfs -text
|
||||
*.xcf filter=lfs diff=lfs merge=lfs -text
|
||||
|
BIN
Editor/rsc/AssetIcon.png
(Stored with Git LFS)
Normal file
BIN
Editor/rsc/AssetIcon.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Editor/rsc/AssetIcon.xcf
(Stored with Git LFS)
Normal file
BIN
Editor/rsc/AssetIcon.xcf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Editor/rsc/FodlerIcon.xcf
(Stored with Git LFS)
Normal file
BIN
Editor/rsc/FodlerIcon.xcf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Editor/rsc/FolderIcon.png
(Stored with Git LFS)
Normal file
BIN
Editor/rsc/FolderIcon.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,4 +1,7 @@
|
||||
#pragma once
|
||||
#include "Project/Project.h"
|
||||
|
||||
|
||||
struct EditorContext {
|
||||
std::shared_ptr<Project> CurrentProject;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "../../YoggieEngine/src/Graphics/Memory/Framebuffer.h"
|
||||
#include "../../YoggieEngine/src/PerfCounter.h"
|
||||
#include "../../YoggieEngine/src/Scene/Entity.h"
|
||||
#include "Project.h"
|
||||
#include "Project/Project.h"
|
||||
|
||||
class EditorRuntime : public ApplicationRuntime {
|
||||
|
||||
@ -31,7 +31,6 @@ public:
|
||||
auto& rendercube2 = cube2.AddComponent<Render3DComponent>();
|
||||
rendercube2.mesh = *(Model->renderable->mesh);
|
||||
|
||||
|
||||
// create an ambient light source
|
||||
auto AmbientLight = MainScene.AddEntity("AmbientLight");
|
||||
auto light = AmbientLight.AddComponent<LightComponent>();
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <iostream>
|
||||
#include "../../YoggieEngine/src/Scene/Components.h"
|
||||
#include "../../YoggieEngine/src/Scene/Entity.h"
|
||||
|
||||
class Editor;
|
||||
|
||||
void ComponentView(const std::string& componentName, voidFunction func)
|
||||
@ -169,7 +170,49 @@ void Console() {
|
||||
}
|
||||
|
||||
void AssetsFinder() {
|
||||
static YoggieEngine::Texture folderIcon ("rsc/folderIcon.png");
|
||||
static YoggieEngine::Texture AssetIcon("rsc/assetIcon.png");
|
||||
static int iconSize = 60;
|
||||
|
||||
ImGui::Begin("Asset-Finder", false);
|
||||
ImGui::Dummy(ImVec2{ 128, 128 });
|
||||
ImGui::DragInt("IconSize", &iconSize, 1, 30, 90);
|
||||
|
||||
|
||||
if (ImGui::BeginTable("##resources", 3))
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.f, 0.f, 0.f, 0.f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.f, 0.f, 0.f, 0.f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.f, 1.f, 1.f, 0.2f));
|
||||
|
||||
for (int row = 0; row < 4; row++) {
|
||||
ImGui::TableNextRow();
|
||||
for (int column = 0; column < 3; column++) {
|
||||
ImGui::TableSetColumnIndex(column);
|
||||
|
||||
if (column % 2) {
|
||||
ImGui::ImageButton(
|
||||
(ImTextureID)folderIcon.GetID(),
|
||||
ImVec2{ (float)iconSize,(float)iconSize });
|
||||
ImGui::Text("Folder %d", row);
|
||||
}
|
||||
else {
|
||||
ImGui::ImageButton(
|
||||
(ImTextureID)AssetIcon.GetID(),
|
||||
ImVec2{ (float)iconSize, (float)iconSize });
|
||||
ImGui::Text("Asset %d", row);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::EndTable();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ImGui::End();
|
||||
}
|
@ -15,7 +15,7 @@ namespace YoggieEngine {
|
||||
glGenTextures(1, &Id);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, Id);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
|
@ -6,7 +6,7 @@ namespace YoggieEngine {
|
||||
|
||||
void Bind();
|
||||
void Unbind();
|
||||
|
||||
const unsigned int GetID() const { return Id; }
|
||||
private:
|
||||
unsigned int Id;
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
typedef uint64_t ENTITY_UUID;
|
||||
namespace YoggieEngine {
|
||||
class Scene;
|
||||
class Entity {
|
||||
|
16
YoggieEngine/src/Scene/UUID.h
Normal file
16
YoggieEngine/src/Scene/UUID.h
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
class UUID {
|
||||
|
||||
public:
|
||||
static uint64_t Generate()
|
||||
{
|
||||
return ++last;
|
||||
}
|
||||
|
||||
private:
|
||||
static uint64_t last ;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user