mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-19 09:34:18 +02:00
Imgui integration began switching dialogs over to new system, work in progress!
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#define UNICODE
|
||||
#include "DirectDrawWrapper.h"
|
||||
#include "imgui.h"
|
||||
#include "examples/imgui_impl_win32.h"
|
||||
#include "examples/imgui_impl_dx9.h"
|
||||
//#include "resource.h"
|
||||
LPDIRECT3DDEVICE9 globald3d9Device;
|
||||
|
||||
/*******************
|
||||
**IUnknown methods**
|
||||
@@ -1239,6 +1243,8 @@ HRESULT IDirectDrawWrapper::WrapperInitialize(WNDPROC wp, HMODULE hMod)
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
void (*Imgui_Dialog_Function)(void) = nullptr;
|
||||
|
||||
/* Helper function to present the d3d surface
|
||||
*
|
||||
*/
|
||||
@@ -1315,6 +1321,19 @@ HRESULT IDirectDrawWrapper::Present()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Imgui_Dialog_Function) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
io.DisplaySize = ImVec2(displayWidth, displayHeight);
|
||||
ImGui_ImplDX9_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
Imgui_Dialog_Function();
|
||||
|
||||
ImGui::Render();
|
||||
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
|
||||
// Display menu options
|
||||
if(inMenu)
|
||||
{
|
||||
@@ -1959,6 +1978,8 @@ bool IDirectDrawWrapper::CreateD3DDevice()
|
||||
MessageBox(NULL, TEXT("Failed to create Direct3DX9 sprite."), TEXT("Direct3DX9 Error"), MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
globald3d9Device = d3d9Device;
|
||||
|
||||
debugMessage(2, "IDirectDrawWrapper::createD3DDevice", "Create D3D9 Object");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user