XiongFJ

寄蜉蝣于天地,渺沧海之一粟

EasyX 安装程序 25.9.10(基于 Nuklear)

编译环境:VisualStudio 2022 + EasyX_25.9.10

代码片段:

// 主函数
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
	initgraph(WIDTH, HEIGHT);

	TCHAR buf[100] = { '\0' };
	_stprintf(buf, _T("%s %s %s"), _T("EasyX"), EASYX_VER, _T("安装向导"));
	window_title = tochar(buf);

	struct nk_context* ctx;
	HWND wnd;
	HDC dc;
	int needs_refresh = 1;
	wnd = GetHWnd();
	dc = GetDC(wnd);
	SetWindowTextW(wnd, towchar(buf));

	font = nk_easyxfont_create("Segoe UI", fontsize);
	ctx = nk_easyx_init(font, dc, WIDTH, HEIGHT);
	MyWindow window(ctx, WIDTH, HEIGHT);

	InitIDE();

	BeginBatchDraw();
	while (running)
	{
		ExMessage msg;
		nk_input_begin(ctx);

		while (peekmessage(&msg))
		{
			if (msg.message == WM_QUIT)
				running = 0;

			nk_easyx_handle_event(wnd, &msg);
			needs_refresh = 1;
		}
		nk_input_end(ctx);

		window.Draw();

		nk_easyx_render(nk_rgb(99, 99, 99));
		FlushBatchDraw();

		Sleep(10);
	}

	EndBatchDraw();
	nk_easyxfont_del(font);
	ReleaseDC(wnd, dc);

	closegraph();
	return 0;
}

运行截图:

Girhub 地址:

https://github.com/easyx-cn/EasyXSetup

项目源码下载:

EasyXSetup.7z

添加评论