testbed: use meta info
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <component/renderable_component.h>
|
#include <component/renderable_component.h>
|
||||||
#include <entt/entity/registry.hpp>
|
#include <entt/entity/registry.hpp>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
#include <meta/meta.h>
|
||||||
#include <system/hud_system.h>
|
#include <system/hud_system.h>
|
||||||
#include <system/imgui_system.h>
|
#include <system/imgui_system.h>
|
||||||
#include <system/input_system.h>
|
#include <system/input_system.h>
|
||||||
@@ -64,9 +65,6 @@ application::~application() {
|
|||||||
static void static_setup_for_dev_purposes(entt::registry ®istry) {
|
static void static_setup_for_dev_purposes(entt::registry ®istry) {
|
||||||
const auto entt = registry.create();
|
const auto entt = registry.create();
|
||||||
|
|
||||||
registry.emplace<double>(entt, 1.2);
|
|
||||||
registry.emplace<int>(entt, 3);
|
|
||||||
|
|
||||||
registry.emplace<input_listener_component>(entt);
|
registry.emplace<input_listener_component>(entt);
|
||||||
registry.emplace<position_component>(entt, SDL_FPoint{400.f, 400.f});
|
registry.emplace<position_component>(entt, SDL_FPoint{400.f, 400.f});
|
||||||
registry.emplace<rect_component>(entt, SDL_FRect{0.f, 0.f, 20.f, 20.f});
|
registry.emplace<rect_component>(entt, SDL_FRect{0.f, 0.f, 20.f, 20.f});
|
||||||
@@ -77,6 +75,7 @@ int application::run() {
|
|||||||
entt::registry registry{};
|
entt::registry registry{};
|
||||||
context context{};
|
context context{};
|
||||||
|
|
||||||
|
meta_setup();
|
||||||
static_setup_for_dev_purposes(registry);
|
static_setup_for_dev_purposes(registry);
|
||||||
|
|
||||||
quit = false;
|
quit = false;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#include <component/input_listener_component.h>
|
||||||
|
#include <component/rect_component.h>
|
||||||
|
#include <component/renderable_component.h>
|
||||||
#include <entt/davey/davey.hpp>
|
#include <entt/davey/davey.hpp>
|
||||||
#include <entt/entity/registry.hpp>
|
#include <entt/entity/registry.hpp>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
@@ -11,11 +14,11 @@ void imgui_system(const entt::registry ®istry) {
|
|||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
ImGui::Begin("Davey - view");
|
ImGui::Begin("Davey - view");
|
||||||
entt::davey(registry.view<int, double>());
|
entt::davey(registry.view<renderable_component, rect_component>());
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
ImGui::Begin("Davey - storage");
|
ImGui::Begin("Davey - storage");
|
||||||
entt::davey(*registry.storage<int>());
|
entt::davey(*registry.storage<input_listener_component>());
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user