#include <windows.h>
#include "mandelbrot_app.h"

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) {
    // Check for DirectX 11 support
    if (FAILED(D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0,
        D3D11_SDK_VERSION, nullptr, nullptr, nullptr))) {
        MessageBox(nullptr, L"DirectX 11 is not available on this system.", L"Error", MB_OK | MB_ICONERROR);
        return 1;
    }

    try {
        MandelbrotApp app(hInstance);
        app.Run();
    }
    catch (...) {
        MessageBox(nullptr, L"An unexpected error occurred.", L"Error", MB_OK | MB_ICONERROR);
        return 1;
    }

    return 0;
}