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.
Inheritance
Inherited Members
Namespace: ImGuiScene
Assembly: ImGuiScene.dll
Syntax
public class SimpleD3D : IRenderer, IDisposable
Properties
| Improve this Doc View SourceClearColor
The renderer clear color used by Clear()
Declaration
public Vector4 ClearColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Numerics.Vector4 |
Debuggable
Whether this renderer was created with debuggable state.
Declaration
public bool Debuggable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Type
The type (API/version) of this renderer
Declaration
public RendererFactory.RendererBackend Type { get; }
Property Value
| Type | Description |
|---|---|
| RendererFactory.RendererBackend |
Vsync
Whether or not the renderer should sync presentation to the monitor's refresh rate.
Declaration
public bool Vsync { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceAttachToWindow(SimpleSDLWindow)
Initialize DirectX 11 for the specified window.
Declaration
public void AttachToWindow(SimpleSDLWindow sdlWindow)
Parameters
| Type | Name | Description |
|---|---|---|
| SimpleSDLWindow | sdlWindow | The SimpleSDLWindow to render into |
Clear()
Clears the render target
Declaration
public void Clear()
CreateTexture(Void*, Int32, Int32, Int32)
Helper method to create a shader resource view from raw image data.
Declaration
public TextureWrap CreateTexture(void *pixelData, int width, int height, int bytesPerPixel)
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 |
Returns
| Type | Description |
|---|---|
| TextureWrap | The wrapped ShaderResourceView created for the image, null on failure. |
Remarks
The ShaderResourceView created by this method is not managed, and it is up to calling code to invoke Dispose() when done
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Finalize()
Declaration
protected void Finalize()
ImGui_Init()
Declaration
public void ImGui_Init()
ImGui_NewFrame()
Declaration
public void ImGui_NewFrame()
ImGui_RenderDrawData(ImDrawDataPtr)
Declaration
public void ImGui_RenderDrawData(ImDrawDataPtr drawData)
Parameters
| Type | Name | Description |
|---|---|---|
| ImDrawDataPtr | drawData |
ImGui_Shutdown()
Declaration
public void ImGui_Shutdown()
Present()
Swap render buffers to the screen. This is currently hardcoded to occur on vsync.
Declaration
public void Present()