mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-25 01:33:51 +02:00
render flag
This commit is contained in:
@@ -20,6 +20,7 @@ namespace VRCX
|
|||||||
private GCHandle _paintBuffer;
|
private GCHandle _paintBuffer;
|
||||||
private int _width;
|
private int _width;
|
||||||
private int _height;
|
private int _height;
|
||||||
|
private bool _dirty;
|
||||||
|
|
||||||
public OffScreenBrowser(string address, int width, int height)
|
public OffScreenBrowser(string address, int width, int height)
|
||||||
: base(
|
: base(
|
||||||
@@ -61,6 +62,9 @@ namespace VRCX
|
|||||||
|
|
||||||
public void RenderToTexture(Texture2D texture)
|
public void RenderToTexture(Texture2D texture)
|
||||||
{
|
{
|
||||||
|
if (_dirty == true)
|
||||||
|
{
|
||||||
|
_dirty = false;
|
||||||
_paintBufferLock.EnterReadLock();
|
_paintBufferLock.EnterReadLock();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -110,6 +114,7 @@ namespace VRCX
|
|||||||
_paintBufferLock.ExitReadLock();
|
_paintBufferLock.ExitReadLock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScreenInfo? IRenderHandler.GetScreenInfo()
|
ScreenInfo? IRenderHandler.GetScreenInfo()
|
||||||
{
|
{
|
||||||
@@ -173,6 +178,7 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
_paintBufferLock.ExitWriteLock();
|
_paintBufferLock.ExitWriteLock();
|
||||||
}
|
}
|
||||||
|
_dirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user