render flag

This commit is contained in:
pypy
2021-02-04 17:13:22 +09:00
parent 82bc457a91
commit ed681f4d08

View File

@@ -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;
} }
} }