|
12 | 12 | using T3.Core.Resource;
|
13 | 13 | using DeviceContext = OpenGL.DeviceContext;
|
14 | 14 | using Resource = SharpDX.DXGI.Resource;
|
| 15 | +using DXTexture2D = SharpDX.Direct3D11.Texture2D; |
15 | 16 |
|
16 | 17 | namespace Lib.io.video
|
17 | 18 | {
|
@@ -76,11 +77,11 @@ private unsafe bool GetSenderInfo(ref uint width, ref uint height, ref IntPtr dx
|
76 | 77 | return _spoutDX.GetSenderInfo(_receiverName, ref width, ref height, handle, ref dwFormat);
|
77 | 78 | }
|
78 | 79 |
|
79 |
| - private static Texture2D CreateD3D11Texture2D(Texture2D d3d11Texture2D) |
| 80 | + private static DXTexture2D CreateD3D11Texture2D(DXTexture2D d3d11Texture2D) |
80 | 81 | {
|
81 | 82 | using (var resource = d3d11Texture2D.QueryInterface<Resource>())
|
82 | 83 | {
|
83 |
| - return ResourceManager.Device.OpenSharedResource<Texture2D>(resource.SharedHandle); |
| 84 | + return ResourceManager.Device.OpenSharedResource<DXTexture2D>(resource.SharedHandle); |
84 | 85 | }
|
85 | 86 | }
|
86 | 87 |
|
@@ -200,7 +201,7 @@ private bool ReceiveTexture(string receiverName)
|
200 | 201 | if (!_spoutDX.IsFrameNew)
|
201 | 202 | return true;
|
202 | 203 |
|
203 |
| - Texture2D readTexture = new Texture2D(_spoutDX.SenderTexture.__Instance); |
| 204 | + Texture2D readTexture = new Texture2D(new DXTexture2D(_spoutDX.SenderTexture.__Instance)); |
204 | 205 |
|
205 | 206 | // check the input format
|
206 | 207 | uint senderWidth = 0;
|
@@ -251,7 +252,7 @@ private bool ReceiveTexture(string receiverName)
|
251 | 252 |
|
252 | 253 | for (var i = 0; i < NumTextureEntries; ++i)
|
253 | 254 | {
|
254 |
| - ImagesWithGpuAccess.Add(new Texture2D(device, imageDesc)); |
| 255 | + ImagesWithGpuAccess.Add(new Texture2D(new DXTexture2D(device, imageDesc))); |
255 | 256 | }
|
256 | 257 | _width = width;
|
257 | 258 | _height = height;
|
|
0 commit comments