3d renderer
This commit is contained in:
@@ -170,4 +170,9 @@ namespace OpenEngine {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void MeshOnImGuiRender(entt::registry®istry, entt::entity entity)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace OpenEngine {
|
||||
RegisterDrawer<TransformComponent>("Transform", &TransformOnImGuiRender);
|
||||
RegisterDrawer<SpriteRendererComponent>("Sprite Renderer", &SpriteOnImGuiRender);
|
||||
RegisterDrawer<CameraComponent>("Camera", &CameraOnImGuiRender);
|
||||
RegisterDrawer<MeshComponent>("Mesh", &MeshOnImGuiRender);
|
||||
|
||||
scene = context;
|
||||
selected_context = {};
|
||||
@@ -32,17 +33,22 @@ namespace OpenEngine {
|
||||
ImGui::SeparatorText("Add");
|
||||
if (!selected_context.HasComponent<TransformComponent>())
|
||||
if (ImGui::MenuItem("Transform")) {
|
||||
selected_context.AddComponents<TransformComponent>();
|
||||
selected_context.AddComponent<TransformComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (!selected_context.HasComponent<SpriteRendererComponent>())
|
||||
if (ImGui::MenuItem("Sprite")) {
|
||||
selected_context.AddComponents<SpriteRendererComponent>();
|
||||
selected_context.AddComponent<SpriteRendererComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (!selected_context.HasComponent<CameraComponent>())
|
||||
if (ImGui::MenuItem("Camera")) {
|
||||
selected_context.AddComponents<CameraComponent>();
|
||||
selected_context.AddComponent<CameraComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (!selected_context.HasComponent<MeshComponent>())
|
||||
if (ImGui::MenuItem("Mesh")) {
|
||||
selected_context.AddComponent<MeshComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
@@ -202,6 +208,7 @@ namespace OpenEngine {
|
||||
entity.GetComponents<TagComponent>();
|
||||
TagOnImGuiRender(reg, entity);
|
||||
|
||||
|
||||
std::vector<entt::id_type> component_to_delete; // 0 is null/invalid in entt usually
|
||||
// Iterate through every component type entt knows about
|
||||
for (auto [id, storage] : reg.storage()) {
|
||||
|
||||
Reference in New Issue
Block a user