Jump to content

ImGui Library Support


Recommended Posts

  • Honorable Member

This is the hidden content, please

This is the hidden content, please

.jpg

 

Requirements:

  •  DirectX 9+

 

Branch:

  •    docking

 

About Library:

Spoiler

This is the hidden content, please
/

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

Even americas uses it:

.jpg

 

Edited by Mali
  • Metin2 Dev 117
  • Good 20
  • Love 18

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • Honorable Member

UPDATE:

  • DirectX 8 Support.
  • WantCaptureMouse, WantCaptureKeyboard fixes.

 

 

Known Problems:

  • Directx 8 doesn't support D3DRS_SCISSORTESTENABLE.
  • You cannot take Imgui off screen in DirectX 8 version.
Edited by Mali
  • Metin2 Dev 4
  • Love 1

 

Link to comment
Share on other sites

  • Premium

Wanted to point out that on device reset, you might get your whole client frozen. That happens because the imgui's objects aren't invalidated & created again.

To fix it, use Imgui's own implementations inside CGraphicDevice::Reset:

 

bool CGraphicDevice::Reset()
{
	HRESULT hr;
	if (FAILED(hr = ms_lpd3dDevice->TestCooperativeLevel()))
	{
		if (hr == D3DERR_DEVICELOST)
			return false;
		
		if (hr == D3DERR_DEVICENOTRESET)
		{
			__DestroyPDTVertexBufferList();
			ImGui_ImplDX9_InvalidateDeviceObjects();
			
			if (FAILED(hr = ms_lpd3dDevice->Reset(&ms_d3dPresentParameter))) {
				TraceError("Failed to reset device");
				return false;
			}
			
			m_pStateManager->SetDefaultState();
			if (!__CreatePDTVertexBufferList())
				return false;
			
			ImGui_ImplDX9_CreateDeviceObjects();
		}
	}
	
	return true;
}


Don't forget to include imgui.h and imgui_impl_dx9.h (or imgui_impl_dx8.h depending on what you're using)

Edited by dumita123
  • Love 1
Link to comment
Share on other sites

  • 1 month later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.