ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
61.16k stars 10.31k forks source link

Add support for dx8/d3d8 #5379

Closed Lioncky closed 2 years ago

Lioncky commented 2 years ago

I tried to make dx8 backend for imgui,and half done. Not sure why render crash while 2 window exist at the same time. Here is my code and the image. image

Maybe here can be replace but i am not sure. image example_win32_directx8.zip Microsoft DirectX 8.1 SDK Lite.zip

Lioncky commented 2 years ago

This image shows the prob i mentioned last post. JD{FUG{EK_8H6NNIK@_J7YF

Lioncky commented 2 years ago

Microsoft DirectX 8.1B Complete SDK, if you should debug, download this you will feel a little different to dx9sdk

Add Environment Variable $(DXSDK_81) C:\Program Files (x86)\Microsoft DirectX 8.1 SDK\ Microsoft DirectX 8.1 SDK.rar 3 button all can download.

Lioncky commented 2 years ago

d3d8 wndproc need add

case WM_PAINT: //Render(); ? ValidateRect(hWnd, NULL); return 0;

Lioncky commented 2 years ago

Other trouble were found, no solution yet.

OutofRange OutofRange The help maker is the multi window as well. CoverHelperMaker

ocornut commented 2 years ago

Hello,

Hopefully you’ll get it solved soon. If you get a working DX8 backend please host it in a github repo (as eg: imgui_impl_dx8.cpp) and we’re link to it.

However please be mindful this place is not a chat room, please refrain from posting too often as your messages are landing in people inbox.

cheers

Lioncky commented 2 years ago

Here backends with source, have uploaded yesterday. example_win32_directx8.zip

I won't reply till i solve this. cheers.

ocornut commented 2 years ago

Closing this. When backend is done you can host on github and we'll happily link to it from Backends and Wiki pages. Thank you!

dhanax26 commented 1 year ago

Other trouble were found, no solution yet.

you can fix it by creating the state block of directx8 and then capturing/aplying and deleting it.

bd->pd3dDevice->CaptureStateBlock(d3d8_state_block); if (bd->pd3dDevice->CaptureStateBlock(d3d8_state_block) < 0) { bd->pd3dDevice->DeleteStateBlock(d3d8_state_block); return; } and at the end of ImGui_ImplDX8_RenderDrawData bd->pd3dDevice->ApplyStateBlock(d3d8_state_block); bd->pd3dDevice->DeleteStateBlock(d3d8_state_block);