删除ECS模式
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
#include "mirage_stb_image.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
mirage_app app;
|
||||
app.init();
|
||||
mirage_app::get().init();
|
||||
|
||||
auto file = mapped_file::create();
|
||||
file->map_file(L"Z:/Root/Local/NanakoDisk/涩图/可爱偷猴计划/东风谷早苗/57092520_p1.jpg");
|
||||
@@ -26,32 +25,11 @@ int main(int argc, char* argv[]) {
|
||||
auto accessor = pixel_factory::create_image_accessor(pixel_format, heap->data, heap->info.width, heap->info.height);
|
||||
pixel_factory::destroy_image_accessor(accessor);
|
||||
|
||||
auto window = std::make_shared<mwindow>();
|
||||
window->create_window(800, 600, L"Hello, World!");
|
||||
window->show();
|
||||
auto window = std::make_shared<mwindow>(800, 600, L"Hello, World!");
|
||||
window->set_content(
|
||||
std::make_shared<mbutton>()
|
||||
);
|
||||
|
||||
mirage_app::get_render_context()->setup_surface(window.get());
|
||||
widget_manager::get().init_window(window);
|
||||
|
||||
auto weak_vbox = widget_manager::get().new_widget<mv_box>(window.get());
|
||||
auto vbox = weak_vbox.lock();
|
||||
|
||||
vbox->add_child<mbutton>().margin({ 5 });
|
||||
vbox->add_child<mbutton>().margin({ 5 }).stretch(1);
|
||||
|
||||
auto weak_hbox = vbox->add_child<mh_box>().stretch(2).get();
|
||||
auto hbox = std::static_pointer_cast<mh_box>(weak_hbox.lock());
|
||||
hbox->add_child<mbutton>().margin({ 5 });
|
||||
hbox->add_child<mbutton>().margin({ 5 }).stretch();
|
||||
hbox->add_child<mbutton>().margin({ 5 });
|
||||
|
||||
|
||||
vbox->add_child<mbutton>().margin({ 5 });
|
||||
vbox->add_child<mbutton>().margin({ 5 });
|
||||
|
||||
|
||||
window->set_content(vbox);
|
||||
|
||||
app.run();
|
||||
mirage_app::get().run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user