From 6008331fc54bbce9eb0837df1f7e71d18d244527 Mon Sep 17 00:00:00 2001 From: ChestnutYueyue <952134128@qq.com> Date: Wed, 18 Feb 2026 17:23:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(text=5Frendering):=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97=E5=B9=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=97=A5=E5=BF=97=E5=AE=8F=E6=9B=BF=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 替换直接使用std::cout和std::cerr输出调试信息为E2D_LOG_INFO宏 移除未使用的argc和argv参数 --- examples/text_rendering/main.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/examples/text_rendering/main.cpp b/examples/text_rendering/main.cpp index ce82b0c..83da8bc 100644 --- a/examples/text_rendering/main.cpp +++ b/examples/text_rendering/main.cpp @@ -113,10 +113,6 @@ private: }; int main(int argc, char *argv[]) { - (void)argc; - (void)argv; - - std::cout << "Extra2D Text Rendering Demo - Starting..." << std::endl; Application &app = Application::get(); @@ -133,18 +129,14 @@ int main(int argc, char *argv[]) { app.use([](auto &cfg) { cfg.priority = 20; }); - std::cout << "Initializing application..." << std::endl; if (!app.init()) { - std::cerr << "Failed to initialize application!" << std::endl; + E2D_LOG_INFO("Failed to initialize application!"); return -1; } - std::cout << "Application initialized successfully!" << std::endl; - - auto *win = app.window(); + auto win = app.window(); if (win) { - std::cout << "Window: " << win->width() << "x" << win->height() - << std::endl; + E2D_LOG_INFO("Window :{} x {}", win->width(), win->height()); } // 设置事件监听 @@ -186,15 +178,8 @@ int main(int argc, char *argv[]) { app.enterScene(scene); - std::cout << "\nControls:" << std::endl; - std::cout << " ESC - Exit" << std::endl; - std::cout << "\nRunning main loop...\n" << std::endl; - app.run(); - std::cout << "Shutting down..." << std::endl; app.shutdown(); - - std::cout << "Goodbye!" << std::endl; return 0; }