Table of Contents

Interface IRenderTarget

Namespace
BSGameLib.Game.Rendering
Assembly
BSGameLib.Game.dll

Represents a backend-provided renderable texture surface.

public interface IRenderTarget : ITexture, IDisposable
Inherited Members

Properties

FrameBufferHandle

Backend-specific framebuffer handle. Currently used by the OpenGL render device.

int FrameBufferHandle { get; }

Property Value

int

Methods

BindFramebuffer()

Makes this target the one drawn into.

void BindFramebuffer()

EncodeToPng()

Encodes the current contents to PNG bytes in memory, without touching disk.

byte[] EncodeToPng()

Returns

byte[]

SaveToFile(string, bool)

Saves the contents of the target to path as a PNG. The OpenGL target saves once, and later calls do nothing unless force is true.

void SaveToFile(string path, bool force = false)

Parameters

path string
force bool

ToTexture()

Returns the target as a texture, which can be drawn as an image.

ITexture ToTexture()

Returns

ITexture

UnbindFramebuffer()

Stops drawing into this target.

void UnbindFramebuffer()