This commit is contained in:
Hartmut Seichter 2020-12-04 22:05:04 +01:00
parent 425072bdec
commit 2ef6af25c1
85 changed files with 43072 additions and 120 deletions

View file

@ -10,15 +10,43 @@
#include <iostream>
int main(int argc,char **argv) {
using pw::scene;
auto s = std::make_unique<scene>();
auto e = s->create_entity();
using pw::scene;
using pw::entity;
// e.add_component<transform>();
struct test {
int val = 0;
test(int v) : val(v) {}
};
void test_stack()
{
auto s = scene();
auto e = entity(s);
auto t = e.add_component<test>(112);
std::cout << t.val << std::endl;
}
void test_heap()
{
auto s = std::make_unique<scene>();
auto e = std::make_unique<entity>(*s);
auto t = e->add_component<test>(112);
std::cout << t.val << std::endl;
}
int main()
{
test_stack();
test_heap();
}