Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement SDL/dx11 sample #2630

Closed
wants to merge 1 commit into from
Closed

Implement SDL/dx11 sample #2630

wants to merge 1 commit into from

Conversation

yaz0r
Copy link
Contributor

@yaz0r yaz0r commented Jun 16, 2019

Implement SDL/dx11 sample
Add support for viewport when using SDL with dx11

Addressing comments mentioned in #2482

Add support for viewport when using SDL with dx11
@ocornut
Copy link
Owner

ocornut commented Jun 17, 2019

Thank you Vincent.
What I will do is to first merge the equivalent code in the master branch, then in a second step merge the changes for multi-viewports. If you can I'd suggest making the PR (I think you had the commit) for master first.

Since you changed _dx11 to use PlatformHandleRaw this is presumably breaking other back-ends/examples which don't set this value.

Linking to #2612.

@@ -564,8 +564,8 @@ static void ImGui_ImplDX11_CreateWindow(ImGuiViewport* viewport)
ImGuiViewportDataDx11* data = IM_NEW(ImGuiViewportDataDx11)();
viewport->RendererUserData = data;

HWND hwnd = (HWND)viewport->PlatformHandle;
IM_ASSERT(hwnd != 0);
assert(viewport->PlatformHandleRaw);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IM_ASSERT

EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_sdl_directx11.vcxproj", "example_sdl_directx11\example_sdl_directx11.vcxproj.vcxproj", "{9E1987E3-1F19-45CA-B9C9-D31E791836D8}"
EndProject
Global
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't add this to the default SLN as there's no reliable way to guarantee it'll compile under Windows without SDL installed somewhere in a folder accessible by the compiler.

@yaz0r
Copy link
Contributor Author

yaz0r commented Jun 17, 2019

Sure, I'll split it up later today.
For the PlatformHandleRaw and other backend, I'll change so that we use PlatformHandle in the old way if PlatformHandleRaw is null. I think that should make other backend work without changes.

@yaz0r yaz0r mentioned this pull request Jun 18, 2019
@yaz0r yaz0r closed this Jun 18, 2019
@yaz0r
Copy link
Contributor Author

yaz0r commented Jun 18, 2019

Superseded by #2630

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants