#include <DxLib.h>

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    ChangeWindowMode(TRUE);
    SetGraphMode(640, 480, 32);
    SetMainWindowText(L"C++ Basics");
    if (DxLib_Init() == -1)
        return -1;

    SetDrawScreen(DX_SCREEN_BACK);
    SetBackgroundColor(245, 248, 252);

    int image = LoadGraph(L"Assets/Images/Robot.png");
    if (image == -1)
    {
        MessageBoxW(nullptr, L"Assets/Images/Robot.png を読み込めません。", L"画像の確認", MB_OK);
        DxLib_End();
        return -1;
    }

    int x = 160;
    int y = 120;

    while (ProcessMessage() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0)
    {
        ClearDrawScreen();
        DrawGraph(x, y, image, TRUE);
        ScreenFlip();
        WaitTimer(16);
    }

    DeleteGraph(image);
    DxLib_End();
    return 0;
}
