windows imgui

This commit is contained in:
Nanako 2024-06-11 11:45:08 +08:00
parent baaf4c23a3
commit f366339ba1
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
project(imgui LANGUAGES C CXX OBJCXX OBJC)
project(imgui LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_STANDARD 11)

View File

@ -130,8 +130,22 @@ void shutdown_imgui() {
::DestroyWindow(hwnd);
::UnregisterClassW(wc.lpszClassName, wc.hInstance);
}
// Helper functions
void run_imgui() {
init_imgui();
while (true) {
if (!imgui_new_frame()) {
break;
}
ImGuiIO& io = ImGui::GetIO();
tick_imgui(io.DeltaTime);
draw_imgui(io.DeltaTime);
render_imgui();
}
shutdown_imgui();
}
// Helper functions
bool CreateDeviceD3D(HWND hWnd) {
// Setup swap chain
DXGI_SWAP_CHAIN_DESC sd;