Class SimpleD3D
A simple wrapper for a minimal DirectX 11 renderer. Consumers of this class will need to implement all actual pipeline and render logic externally.
Assembly: ImGuiScene.dll
View Source
public class SimpleD3D : IRenderer, IDisposable
Implements:
ImGuiScene.IRenderer, System.IDisposable
Properties
Type
The type (API/version) of this renderer
View Source
public RendererFactory.RendererBackend Type { get; }
ClearColor
The renderer clear color used by ImGuiScene.SimpleD3D.Clear()
View Source
public Vector4 ClearColor { get; set; }
Vsync
Whether or not the renderer should sync presentation to the monitor's refresh rate.
View Source
public bool Vsync { get; set; }
Debuggable
Whether this renderer was created with debuggable state.
View Source
public bool Debuggable { get; }
Methods
AttachToWindow(SimpleSDLWindow)
Initialize DirectX 11 for the specified window.
View Source
public void AttachToWindow(SimpleSDLWindow sdlWindow)
Parameters
Type | Name | Description |
---|---|---|
ImGuiScene.SimpleSDLWindow | sdlWindow | The SimpleSDLWindow to render into |
Clear()
Clears the render target
View Source
public void Clear()
Present()
Swap render buffers to the screen. This is currently hardcoded to occur on vsync.
View Source
public void Present()
CreateTexture(void*, int, int, int)
Helper method to create a shader resource view from raw image data.
View Source
public TextureWrap CreateTexture(void* pixelData, int width, int height, int bytesPerPixel)
Returns
ImGuiScene.TextureWrap: The wrapped ShaderResourceView created for the image, null on failure.
Parameters
Type | Name | Description |
---|---|---|
System.Void* | pixelData | A pointer to the raw pixel data |
System.Int32 | width | The width of the image |
System.Int32 | height | The height of the image |
System.Int32 | bytesPerPixel | The bytes per pixel of the image, used for stride calculations |
ImGui_Init()
View Source
public void ImGui_Init()
ImGui_Shutdown()
View Source
public void ImGui_Shutdown()
ImGui_NewFrame()
View Source
public void ImGui_NewFrame()
ImGui_RenderDrawData(ImDrawDataPtr)
View Source
public void ImGui_RenderDrawData(ImDrawDataPtr drawData)
Parameters
Type | Name |
---|---|
ImGuiNET.ImDrawDataPtr | drawData |
Dispose(bool)
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
~SimpleD3D()
View Source
protected ~SimpleD3D()
Dispose()
View Source
public void Dispose()
Implements
- ImGuiScene.IRenderer
System.IDisposable