#include "../Engine/Core/engine.h" #include "../Engine/Core/logger.h" #include "../Engine/Core/timer.h" #include "../Engine/Window/window.h" #include "../Engine/Rendering/graphics_device.h" #include "../Engine/include/engine_api.h" #include "../Engine/ASM/math_c_fallback.h" #include "../Engine/Editor/editor.h" #include static GraphicsDevice* g_dev = NULL; static Editor g_editor; static void on_render(Engine* engine) { if (!g_dev) return; editor_update(&g_editor, (float)engine->delta_time); editor_render(&g_editor); graphics_device_present(g_dev); } static void on_key(Engine* engine, int key) { if (key == VK_ESCAPE) engine_request_quit(engine); } int main(int argc, char* argv[]) { (void)argc; (void)argv; LOG_INFO("=== MiMo Engine Editor ==="); EngineConfig config = engine_default_config(); config.app_name = "MiMo Engine Editor"; config.vsync = 1; config.window_width = 1440; config.window_height = 900; Engine* engine = engine_create(); if (!engine_init(engine, &config)) { LOG_FATAL("Engine init failed"); return -1; } g_dev = graphics_device_create(); if (!graphics_device_init(g_dev, window_get_handle(engine->window), config.window_width, config.window_height, 1)) { LOG_FATAL("D3D11 init failed"); return -1; } LOG_INFO("D3D11 device ready: %dx%d", config.window_width, config.window_height); if (!editor_init(&g_editor, g_dev)) { LOG_FATAL("Editor init failed"); return -1; } LOG_INFO("Editor initialized"); engine_set_render_callback(engine, on_render); engine_set_key_callback(engine, on_key); LOG_INFO("Running editor..."); engine_run(engine); editor_shutdown(&g_editor); graphics_device_destroy(g_dev); engine_shutdown(engine); return 0; }