#include "SDL_log.h" #include #include #include #include #include #include #include #include #include using namespace frostbite2D; int main(int argc, char **argv) { AppConfig config = AppConfig::createDefault(); config.appName = "Frostbite2D Test App"; config.appVersion = "1.0.0"; config.windowConfig.width = 800; config.windowConfig.height = 600; config.windowConfig.title = "Frostbite2D - Renderer Test"; Application& app = Application::get(); if (!app.init(config)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to initialize application!"); return -1; } SDL_Log("Starting main loop..."); auto menuScene = MakePtr(); SceneManager::get().PushScene(menuScene); // 先测试彩色四边形,排除纹理问题 SDL_Log("Testing colored quad..."); // 尝试加载精灵 auto sprite = Sprite::createFromFile("assets\\player.png"); if (sprite) { sprite->SetPosition(100, 100); menuScene->AddActor(sprite); SDL_Log("Sprite created and added to scene"); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to create sprite from file!"); } app.run(); app.shutdown(); SDL_Log("Application exited normally"); return 0; }