WiP
This commit is contained in:
parent
425072bdec
commit
2ef6af25c1
85 changed files with 43072 additions and 120 deletions
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue