content browser and textures on entity sprites

This commit is contained in:
Erris
2026-02-27 10:45:44 +01:00
parent cee0f42164
commit 9de9609dee
23 changed files with 809 additions and 213 deletions

View File

@@ -1,3 +1,4 @@
#include "imgui.h"
#include <editor_component.hpp>
#include <open_engine.hpp>
@@ -106,6 +107,16 @@ namespace OpenEngine {
{
auto& sprite = registry.get<SpriteRendererComponent>(entity);
ImGui::ColorEdit4("color", glm::value_ptr(sprite.color));
ImGui::Button("Texture", { 100, 0 });
if (ImGui::BeginDragDropTarget()) {
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("CONTENT_BROWSER_PAYLOAD"))
sprite.texture = Texture2D::Create(((const char*)payload->Data));
ImGui::EndDragDropTarget();
}
ImGui::DragFloat("Tiling factor", &sprite.tiling_factor);
};
void CameraOnImGuiRender(entt::registry& registry, entt::entity entity)