85 lines
1.4 KiB
Plaintext
85 lines
1.4 KiB
Plaintext
#include <dl.h>
|
|
using namespace dl;
|
|
|
|
//Client client;
|
|
//void client_send(void*)
|
|
//{
|
|
// while (true)
|
|
// {
|
|
// //client.Send("客户端发送数据");
|
|
// std::this_thread::sleep_for(std::chrono::seconds(2));
|
|
// }
|
|
//}
|
|
|
|
int main()
|
|
{
|
|
//String::TestSplit();
|
|
Engine::Init();
|
|
|
|
//Mat::Test();
|
|
/*Thread* t = g_thread->Create();
|
|
t->Start(client_send, nullptr);*/
|
|
|
|
//{
|
|
// Server server;
|
|
// if (!server.Accept())
|
|
// {
|
|
// log_err("服务器Accept失败!");
|
|
// return -1;
|
|
// }
|
|
// server.Run();
|
|
|
|
// Client client;
|
|
// if (!client.Connent())
|
|
// {
|
|
// log_err("客户端Connect失败!");
|
|
// return -1;
|
|
// }
|
|
|
|
// size_t i = 0;
|
|
// while (i++ < 10)
|
|
// {
|
|
// log_info("客户端发送!");
|
|
// client.Send(CreateBufferView("Hello dl!"));
|
|
// std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
// }
|
|
//}
|
|
|
|
//TestScript(SCRIPT_TEST_SCOPE);
|
|
|
|
|
|
//Buffer buf = File::GetBuffer("E:/logo.png");
|
|
|
|
//std::string str;
|
|
//str += "constexpr std::vector<unsigned char> g_logoImage = {\n";
|
|
//size_t i = 0;
|
|
//for (auto& ch : buf)
|
|
//{
|
|
// str += fmt::format("0x{:02x}, ", ch);
|
|
// ++i;
|
|
// if (i % 10 == 0)
|
|
// str += "\n";
|
|
//}
|
|
//str += "};\n";
|
|
//File::SaveString(str, "E:/logo.h");
|
|
|
|
Value v = 100;
|
|
|
|
log_msg("{}", to_string(v));
|
|
|
|
Value v1 = "nnnnn";
|
|
log_msg("{}", v1.GetString());
|
|
|
|
std::array<float, 2> xy{ 10,2 };
|
|
|
|
Value v2 = xy;
|
|
log_msg("{}", v2.GetString());
|
|
|
|
g_lua = new LuaScript;
|
|
g_lua->DoFile("main.lua");
|
|
delete g_lua;
|
|
|
|
Engine::Release();
|
|
return 0;
|
|
}
|