zengine/game/zworld/editor/main.cpp

60 lines
1.7 KiB
C++
Raw Normal View History

2024-07-20 18:04:19 +08:00
#include <iostream>
#include <array>
#include <charconv>
#include "engine/api.h"
2024-08-06 16:08:11 +08:00
#include "asset/resource_system.h"
#include "os/file_manager.h"
2024-08-09 22:04:01 +08:00
#include "render/graph/frame_graph.h"
#include "render/pass/demo_pass.h"
#include "zlog.h"
#include "source_location.h"
2024-07-20 18:04:19 +08:00
void test(std::string_view str = "") {
std::cout << "test " << str << std::endl;
}
2024-07-31 10:48:28 +08:00
int main(int argc, char** argv) {
api::ModuleManager::Ptr()->MakeGraph("zworld", true, argc, argv);
2024-08-06 16:08:11 +08:00
auto ptr = api::ResourceSystem::Ptr();
auto ptr2 = api::FileManager::Ptr();
2024-08-09 22:04:01 +08:00
api::FrameGraph graph;
graph.AddRenderPass<api::DemoPass>();
graph.Compile();
graph.Execute();
graph.Clear();
zlog::info("hello world");
2024-07-20 18:04:19 +08:00
test("sss");
using namespace refl;
constexpr TStr str1{ "Hello" };
constexpr TStr str2{ " world" };
constexpr TStr str3 = detail::concat(str1, str2);
constexpr auto r1 = value_name<8 * sizeof(int)>();
constexpr int v = 12;
2024-08-06 16:08:11 +08:00
auto cls = refl::type_info<int>();
2024-07-20 18:04:19 +08:00
//auto str4 = concat(r1, str2);
auto t1 = refl::type_name<int>();
auto v1 = refl::type_name<int>().View();
auto v2 = t1.View();
if (v1 == t1.View()) {
auto t2 = refl::type_name<int16_t>();
auto t3 = refl::type_name<int8_t>();
}
auto t2 = refl::type_name<int16_t>();
auto t3 = refl::type_name<int8_t>();
pmr::FrameAllocatorPool pool;
pmr::Name name = "hello enginehello enginehello engine\n";
pmr::Name name2("hello enginehello enginehello engine\n");
pmr::Name name3("hello enginehello enginehello engine222\n");
if (name == name2) {
std::string s1 = name.ToString();
std::string s2 = name2.ToString();
if (s1.c_str() == s2.c_str()) {
2024-07-31 10:48:28 +08:00
new(&pool)int(1);
2024-07-20 18:04:19 +08:00
}
if (s1 == s2) {
2024-07-31 10:48:28 +08:00
new(&pool)int(1);
2024-07-20 18:04:19 +08:00
}
}
2024-07-31 10:48:28 +08:00
int* a = new(&pool)int(1);
int* b = new(&pool)int(2);
int* c = new(&pool)int(3);
2024-07-20 18:04:19 +08:00
std::cout << "hello engine\n";
}