Added new ComponentWidget and ViewWidget
A Render3DComponent can now be edited, A game view is available in the editor for game runtime rendering
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user