#7195·MonoGame

Class to wrap an ID3D11Texture2D as a RenderTarget2D

Author: YTN0Created Jun 10, 2020Updated Sep 12, 2026
Labelsfeaturescope: apiscope: directxstatus: needs-design

Per the contributor guide, any new code or proposals should first be discussed here.

I would like to submit a class that wraps an ID3D11Texture2D as a RenderTarget2D. I used the SwapChainRenderTarget as a baseline for creating this, and currently have something that works.

This will become useful for anyone interested in OpenXR, since the OpenXR runtime returns an already created ID3D11Texture2D. This differs from the way OpenVR works, since with OpenVR you create the RenderTarget and pass it the handle, as opposed to the other way around for OpenXR.

I currently have the class named D3DRenderTarget, but am open to renaming it. It resides in the same directory and namespace as SwapChainRenderTarget.

Note, this would be for Windows / DirectX only.

I would love to get this into 3.8 so I don't have to run a modified version of the Monogame dll.

Note, this is new functionality and should not impact any existing behavior..

What version of MonoGame does the bug occur on:

  • MonoGame 3.8

What operating system are you using:

  • Windows

What MonoGame platform are you using:

  • WindowsDX