Hi, I’m looking for a method that I can use to draw a texture directly to a display, given its index. I haven’t got a multi-monitor setup to test this on, but I was thinking something along the lines of the following might work.
public static class DisplayUtils
{
public static void DrawTexture(
int targetDisplay,
Texture texture,
Material material)
{
if ((targetDisplay < 0) || (targetDisplay >= Display.displays.Length)) return;
Display display = Display.displays[targetIndex];
if (!display.active)
{
display.Activate();
}
Graphics.SetRenderTarget(display.colorBuffer, display.depthBuffer);
Graphics.DrawTexture(
new Rect(0.0f, 0.0f, display.renderWidth, display.renderHeight),
texture, material);
}
}
I’m basically looking for a way to render a full-size texture to a given display via a specified material without having to use a separate RenderTexture and Canvas .etc.