Skip to content

Commit c1ecdbc

Browse files
committed
maybe fix compile errors ?
1 parent 8ac9bda commit c1ecdbc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Operators/Spout/lib/io/video/SpoutInput.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using T3.Core.Resource;
1313
using DeviceContext = OpenGL.DeviceContext;
1414
using Resource = SharpDX.DXGI.Resource;
15+
using DXTexture2D = SharpDX.Direct3D11.Texture2D;
1516

1617
namespace Lib.io.video
1718
{
@@ -76,11 +77,11 @@ private unsafe bool GetSenderInfo(ref uint width, ref uint height, ref IntPtr dx
7677
return _spoutDX.GetSenderInfo(_receiverName, ref width, ref height, handle, ref dwFormat);
7778
}
7879

79-
private static Texture2D CreateD3D11Texture2D(Texture2D d3d11Texture2D)
80+
private static DXTexture2D CreateD3D11Texture2D(DXTexture2D d3d11Texture2D)
8081
{
8182
using (var resource = d3d11Texture2D.QueryInterface<Resource>())
8283
{
83-
return ResourceManager.Device.OpenSharedResource<Texture2D>(resource.SharedHandle);
84+
return ResourceManager.Device.OpenSharedResource<DXTexture2D>(resource.SharedHandle);
8485
}
8586
}
8687

@@ -200,7 +201,7 @@ private bool ReceiveTexture(string receiverName)
200201
if (!_spoutDX.IsFrameNew)
201202
return true;
202203

203-
Texture2D readTexture = new Texture2D(_spoutDX.SenderTexture.__Instance);
204+
Texture2D readTexture = new Texture2D(new DXTexture2D(_spoutDX.SenderTexture.__Instance));
204205

205206
// check the input format
206207
uint senderWidth = 0;
@@ -251,7 +252,7 @@ private bool ReceiveTexture(string receiverName)
251252

252253
for (var i = 0; i < NumTextureEntries; ++i)
253254
{
254-
ImagesWithGpuAccess.Add(new Texture2D(device, imageDesc));
255+
ImagesWithGpuAccess.Add(new Texture2D(new DXTexture2D(device, imageDesc)));
255256
}
256257
_width = width;
257258
_height = height;

Operators/Spout/lib/io/video/SpoutOutput.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using T3.Core.Resource;
1212
using DeviceContext = OpenGL.DeviceContext;
1313
using Resource = SharpDX.DXGI.Resource;
14+
using DXTexture2D = SharpDX.Direct3D11.Texture2D;
1415

1516
namespace Lib.io.video
1617
{
@@ -54,11 +55,11 @@ private string GetAdapterName()
5455
return adapter;
5556
}
5657

57-
private Texture2D CreateD3D11Texture2D(Texture2D d3d11Texture2D)
58+
private DXTexture2D CreateD3D11Texture2D(DXTexture2D d3d11Texture2D)
5859
{
5960
using (var resource = d3d11Texture2D.QueryInterface<Resource>())
6061
{
61-
return ResourceManager.Device.OpenSharedResource<Texture2D>(resource.SharedHandle);
62+
return ResourceManager.Device.OpenSharedResource<DXTexture2D>(resource.SharedHandle);
6263
}
6364
}
6465

@@ -182,7 +183,7 @@ private bool SendTexture(string senderName, ref Texture2D frame)
182183

183184
for (int i = 0; i < NumTextureEntries; ++i)
184185
{
185-
ImagesWithGpuAccess.Add(new Texture2D(device, imageDesc));
186+
ImagesWithGpuAccess.Add(new Texture2D(new DXTexture2D(device, imageDesc)));
186187
}
187188
_currentIndex = 0;
188189
}
@@ -259,7 +260,7 @@ protected void DisposeTextures()
259260

260261
// hold several textures internally to speed up calculations
261262
private const int NumTextureEntries = 2;
262-
private readonly List<Texture2D> ImagesWithGpuAccess = new();
263+
private readonly List<DXTexture2D> ImagesWithGpuAccess = new();
263264
// current image index (used for circular access of ImagesWithGpuAccess)
264265
private int _currentIndex;
265266

0 commit comments

Comments
 (0)