Table of Contents

Class OffscreenRenderDevice

Namespace
SearchAThing.OpenGL.Core
Assembly
netcore-opengl-core.dll

Render device for offscreen mode that acts as a bitmap file writer.

public class OffscreenRenderDevice : IRenderDevice, INotifyPropertyChanged
Inheritance
OffscreenRenderDevice
Implements
Inherited Members

Constructors

OffscreenRenderDevice(string, in Size)

Create an offscreen render device.

public OffscreenRenderDevice(string pathfilename, in Size size)

Parameters

pathfilename string

Target bitmap pathfilename.

size Size

Size of image created.

Properties

Pathfilename

Pathfilename

public string Pathfilename { get; set; }

Property Value

string

Size

Retrieve actual size of the device screen (pixels).

public Size Size { get; set; }

Property Value

Size

TransferGLPixelsCount

Stats counter of TransferGLPixels(GL) calls.

public int TransferGLPixelsCount { get; set; }

Property Value

int

Methods

OnPropertyChanged(string?)

invoke this method to forward propertchanged event notification. note: not needed to specify propertyName set by compiler service to called property.

protected void OnPropertyChanged(string? propertyName = null)

Parameters

propertyName string

Post(Action)

Used by GLControl to emit PropertyChanged event.
This is needed in most frameworks that allow ui interactions only from the ui thread itself.
Its necessary expecially if want to access ui data from a separate Task running in parallel.

public void Post(Action action)

Parameters

action Action

Action to be executed in ui thread.

TransferGLPixels(GL)

Use given GL object to issue a ReadPixel and transfer them to destination device.
Following some details how this function is involved in the rendering process:

Here an example implementation given from the TransferGLPixels(GL):
\snippet{'trimleft'} src/render/OffscreenRenderDevice.cs OffscreenTrasferGLPixels

public void TransferGLPixels(GL GL)

Parameters

GL GL

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler