You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/SDL2.md
+85Lines changed: 85 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,3 +353,88 @@ if (device->GetDeviceInfo().IsGLDevice())
353
353
- Look at [GetSurfacePretransformMatrix()](https://github.com/DiligentGraphics/DiligentSamples/blob/9be93225a7fdf135583146c1175c232217f310b2/SampleBase/src/SampleBase.cpp#L140) for an example of handling the view matrix.
354
354
-`SDL_GetDisplayOrientation()` can be used to get the device's orientation. Alternatively, listen for the `SDL_DISPLAYEVENT_ORIENTATION` event.
355
355
-`SDL_GetDisplayMode()` can be used to determine max resolution.
356
+
357
+
## ImGui
358
+
### Compiling and Linking
359
+
Whatever is most convenient for your build system, compile and link [imgui_impl_sdl.cpp](https://github.com/DiligentGraphics/imgui/blob/66ad2ad5398cb61433009553e10fd326d13acb84/backends/imgui_impl_sdl.cpp) into your project
360
+
361
+
### Using the ImGuiImplSDL implementation
362
+
#### Setup
363
+
Add the [ImGuiImplSDL.hpp](https://github.com/DiligentGraphics/DiligentTools/blob/fbd6c1054744724387e37ae69b1636782f703ca0/Imgui/interface/ImGuiImplSDL.hpp) header included in Diligent. After creating the swapchain, call `ImGuiImplSDL::Create(CI, sdl_window)` and store the result for usage as normal
364
+
```cpp
365
+
#include"Imgui/interface/ImGuiImplSDL.hpp"
366
+
367
+
// Store somewhere
368
+
std::unique_ptr<ImGuiImplDiligent> imgui_impl{};
369
+
370
+
// Create swapchain...
371
+
372
+
// Create the ImGui implementation object using the device and swapchain description
373
+
auto CI = ImGuiDiligentCreateInfo{*device, SCDesc};
0 commit comments