zengine/game/zworld/editor/main.cpp
2024-08-09 22:04:01 +08:00

60 lines
1.7 KiB
C++

#include <iostream>
#include <array>
#include <charconv>
#include "engine/api.h"
#include "asset/resource_system.h"
#include "os/file_manager.h"
#include "render/graph/frame_graph.h"
#include "render/pass/demo_pass.h"
#include "zlog.h"
#include "source_location.h"
void test(std::string_view str = "") {
std::cout << "test " << str << std::endl;
}
int main(int argc, char** argv) {
api::ModuleManager::Ptr()->MakeGraph("zworld", true, argc, argv);
auto ptr = api::ResourceSystem::Ptr();
auto ptr2 = api::FileManager::Ptr();
api::FrameGraph graph;
graph.AddRenderPass<api::DemoPass>();
graph.Compile();
graph.Execute();
graph.Clear();
zlog::info("hello world");
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;
auto cls = refl::type_info<int>();
//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()) {
new(&pool)int(1);
}
if (s1 == s2) {
new(&pool)int(1);
}
}
int* a = new(&pool)int(1);
int* b = new(&pool)int(2);
int* c = new(&pool)int(3);
std::cout << "hello engine\n";
}