Skip to main content

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
Declaration
public class SimpleD3D : IRenderer, IDisposable

Implements:
ImGuiScene.IRenderer, System.IDisposable

Properties

Type

The type (API/version) of this renderer

View Source
Declaration
public RendererFactory.RendererBackend Type { get; }

ClearColor

The renderer clear color used by ImGuiScene.SimpleD3D.Clear()

View Source
Declaration
public Vector4 ClearColor { get; set; }

Vsync

Whether or not the renderer should sync presentation to the monitor's refresh rate.

View Source
Declaration
public bool Vsync { get; set; }

Debuggable

Whether this renderer was created with debuggable state.

View Source
Declaration
public bool Debuggable { get; }

Methods

AttachToWindow(SimpleSDLWindow)

Initialize DirectX 11 for the specified window.

View Source
Declaration
public void AttachToWindow(SimpleSDLWindow sdlWindow)
Parameters
TypeNameDescription
ImGuiScene.SimpleSDLWindowsdlWindowThe SimpleSDLWindow to render into

Clear()

Clears the render target

View Source
Declaration
public void Clear()

Present()

Swap render buffers to the screen. This is currently hardcoded to occur on vsync.

View Source
Declaration
public void Present()

CreateTexture(void*, int, int, int)

Helper method to create a shader resource view from raw image data.

View Source
Declaration
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
TypeNameDescription
System.Void*pixelDataA pointer to the raw pixel data
System.Int32widthThe width of the image
System.Int32heightThe height of the image
System.Int32bytesPerPixelThe bytes per pixel of the image, used for stride calculations

ImGui_Init()

View Source
Declaration
public void ImGui_Init()

ImGui_Shutdown()

View Source
Declaration
public void ImGui_Shutdown()

ImGui_NewFrame()

View Source
Declaration
public void ImGui_NewFrame()

ImGui_RenderDrawData(ImDrawDataPtr)

View Source
Declaration
public void ImGui_RenderDrawData(ImDrawDataPtr drawData)
Parameters
TypeName
ImGuiNET.ImDrawDataPtrdrawData

Dispose(bool)

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

~SimpleD3D()

View Source
Declaration
protected ~SimpleD3D()

Dispose()

View Source
Declaration
public void Dispose()

Implements