Content browser

This commit is contained in:
Simon Lübeß
2022-07-25 17:03:28 +02:00
parent 0339ae4422
commit bff4418b84
21 changed files with 481 additions and 44 deletions
@@ -35,12 +35,14 @@ namespace GlitchyEditor.EditWindows
_editor = editor;
}
private ImGui.Vec2 oldViewportSize;
private ImGui.Vec2 oldViewportSize = .(100, 100);
private bool viewPortChanged;
public uint32 SelectedEntityId;
public bool SelectionChanged;
public Vector2 ViewportSize => (Vector2)oldViewportSize;
protected override void InternalShow()
{
ImGui.PushStyleVar(.WindowPadding, ImGui.Vec2(1, 1));
@@ -88,6 +90,21 @@ namespace GlitchyEditor.EditWindows
//ImGui.Image(_editor.CurrentCamera.RenderTarget.GetViewBinding(0), viewportSize);
//ImGui.Image(_editor.CurrentScene.[Friend]_compositeTarget.GetViewBinding(0), viewportSize);
}
if (ImGui.BeginDragDropTarget())
{
ImGui.Payload* payload = ImGui.AcceptDragDropPayload("CONTENT_BROWSER_ITEM");
if (payload != null)
{
Log.EngineLogger.Warning("");
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
_editor.RequestOpenScene(this, path);
}
ImGui.EndDragDropTarget();
}
bool gizmoUsed = DrawImGuizmo(viewportSize);