2025-10-11 17:23:58 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
#include "DefaultApp.hpp"
|
2026-02-08 12:09:02 +01:00
|
|
|
#include "ILog.hpp"
|
|
|
|
|
#include "SpdLogger.hpp"
|
|
|
|
|
#include "resource.hpp"
|
2025-10-11 17:23:58 +02:00
|
|
|
|
|
|
|
|
using namespace pixelarium;
|
|
|
|
|
using namespace std;
|
|
|
|
|
using Log = utils::log::ILog;
|
|
|
|
|
using Pool = resources::ImageResourcePool;
|
|
|
|
|
|
|
|
|
|
// setup a logger
|
|
|
|
|
#ifdef _WIN32
|
2026-02-08 12:09:02 +01:00
|
|
|
const auto logger{utils::log::SpdLogger(string(getenv("APPDATA")) + "/pixelarium/simple_app.log", "default")};
|
2025-10-11 17:23:58 +02:00
|
|
|
#else
|
2026-02-08 12:09:02 +01:00
|
|
|
const auto logger{
|
|
|
|
|
utils::log::SpdLogger(string(getenv("HOME")) + "/.cache/pixelarium/simple_app.log", "default")};
|
2025-10-11 17:23:58 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
// some initial log message and default log level setting
|
2026-02-08 12:09:02 +01:00
|
|
|
logger.Info(format("{}: Starting Application {}", __FUNCTION__, "Pixelarium"));
|
|
|
|
|
logger.ChangeLevel(utils::log::LogLevel::kDebug);
|
2025-10-11 17:23:58 +02:00
|
|
|
|
|
|
|
|
// instantiate an image pool for the application
|
|
|
|
|
resources::ImageResourcePool image_pool;
|
|
|
|
|
|
|
|
|
|
// create an application, inject its dependencies and start it
|
2026-02-08 12:09:02 +01:00
|
|
|
auto app{application::DefaultApp(logger, image_pool)};
|
2025-10-11 17:23:58 +02:00
|
|
|
app.Start();
|
|
|
|
|
}
|