A base for a standalone ImGui application. The only file you have to modify is UI.cpp
- windowHandle (HWND)
- windowClass (WNDCLASSEXA)
- windowSize (WindowSize)
- Width (int)
- Height (int)
- windowCoordinates (WindowCoordinates)
- Left (int)
- Right (int)
- Bottom (int)
- Top (int)
- Center (Vector)
- X (int)
- Y (int)
- directX (PDIRECT3D9)
- directXDevice (LPDIRECT3DDEVICE9)
- directXParameters (D3DPRESENT_PARAMETERS)
- imGuiContext (ImGuiContext*)
- imGuiIO (ImGuiIO*)
All ImGui features can be used in the RunUI()
function located in UI.cpp
void RunUI(Window* window) {
ImGui::SetNextWindowPos({ 0, 0 });
ImGui::SetNextWindowSize({ (float)window->windowSize.Width, (float)window->windowSize.Height });
ImGui::Begin(Configuration::Initial::WindowTitle, &window->exiting, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove);
ImGui::Text("Window Width: %d", window->windowSize.Width);
ImGui::Text("Window Height: %d", window->windowSize.Height);
ImGui::Separator();
ImGui::Text("Window Left: %d", window->windowCoordinates.Left);
ImGui::Text("Window Right: %d", window->windowCoordinates.Right);
ImGui::Text("Window Top: %d", window->windowCoordinates.Top);
ImGui::Text("Window Bottom: %d", window->windowCoordinates.Bottom);
ImGui::Text("Window Center: (%d,%d)", window->windowCoordinates.Center.x, window->windowCoordinates.Center.y);
if (ImGui::Button("test"))
MessageBoxA(0, "test", "test", 0);
ImGui::End();
}
You can run anything you need to in the Starting()
function located in UI.cpp
void Starting() {
// Do something here before initializing anything.
}
You can run anything you need to in the Exiting()
function located in UI.cpp
void Exiting() {
// Do something here after right before exiting.
}
You can run anything you need to in the PostInitialization(Window* window)
function located in UI.cpp
void PostInitialization(Window* window)() {
// Do something here before initializing anything.
}
You can run anything you need to in the PreDeinitialization(Window* window)
function located in UI.cpp
void PreDeinitialization(Window* window) {
// Do something here after right before exiting.
}