Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using DirectX SRV with OpenGL Implementation #2733

Closed
nicovanbentum opened this issue Aug 17, 2019 · 2 comments
Closed

Using DirectX SRV with OpenGL Implementation #2733

nicovanbentum opened this issue Aug 17, 2019 · 2 comments
Labels

Comments

@nicovanbentum
Copy link

Branch: Docking
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_dx11.cpp
Operating System: Windows 10

In my current project I switch between DirectX and OpenGL by calling the corresponding 'impl' functions and rendering every frame of my renderer to an fbo that goes to an ImGui::Image.
My new idea is that I want ImGui to render using just OpenGL and that switching API's only changes what I pass to the ImGui::Image as ImTextureID. So basically I want to use imgui_impl_opengl3 but be able to pass a DX ShaderResourceView* to an ImGui::Image. I have read the FAQ but I'm not quite sure I understood everything correctly. Would this require a custom RenderDrawData implementation? or a completely custom impl cpp file that handles both API's?

@ocornut
Copy link
Owner

ocornut commented Sep 17, 2019

It's hard to understand why you would wander into mixing DX and GL this way, but yeah, presently you'll need a custom RenderDrawData implementation. You may copy one of the back-end and modify it.

However it is true that for #2697, #301 we may end up exposing a function pointer to specifically replace the "SetTexture" component of each renderer, in which case what you are trying to do would be easier.

@ocornut
Copy link
Owner

ocornut commented Oct 2, 2019

Closing this as answered.

@ocornut ocornut closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants