winrt-Windows.Graphics.DirectX.Direct3D11.Interop 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (14) hide show
  1. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/PKG-INFO +22 -0
  2. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/README.md +7 -0
  3. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/py.Windows.Graphics.DirectX.Direct3D11.Interop.cpp +217 -0
  4. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/pyproject.toml +45 -0
  5. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/pywinrt-version.txt +1 -0
  6. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/setup.cfg +4 -0
  7. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/setup.py +31 -0
  8. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt/_winrt_windows_graphics_directx_direct3d11_interop.pyi +46 -0
  9. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt/windows/graphics/directx/direct3d11/interop/__init__.py +17 -0
  10. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt/windows/graphics/directx/direct3d11/interop/py.typed +0 -0
  11. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/PKG-INFO +22 -0
  12. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/SOURCES.txt +12 -0
  13. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/dependency_links.txt +1 -0
  14. winrt_windows_graphics_directx_direct3d11_interop-2.3.0/winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Graphics.DirectX.Direct3D11.Interop
3
+ Version: 2.3.0
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Documentation, https://pywinrt.readthedocs.io
7
+ Project-URL: Repository, https://github.com/pywinrt/pywinrt
8
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: Implementation :: CPython
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: <3.14,>=3.9
14
+ Description-Content-Type: text/markdown
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Graphics.DirectX.Direct3D11.Interop
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Graphics.DirectX.Direct3D11.Interop` namespace.
21
+
22
+ This package provides the `winrt.windows.graphics.directx.direct3d11.interop` module.
@@ -0,0 +1,7 @@
1
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
2
+
3
+ # winrt-Windows.Graphics.DirectX.Direct3D11.Interop
4
+
5
+ Windows Runtime (WinRT) APIs for for the `Windows.Graphics.DirectX.Direct3D11.Interop` namespace.
6
+
7
+ This package provides the `winrt.windows.graphics.directx.direct3d11.interop` module.
@@ -0,0 +1,217 @@
1
+ #if __has_include("windows.graphics.directx.direct3d11.interop.h")
2
+ #include <windows.graphics.directx.direct3d11.interop.h>
3
+ #else
4
+ // some environments like MSYS2 don't have the interop header
5
+ #include <dxgi.h>
6
+ #include <inspectable.h>
7
+ #include <unknwn.h>
8
+
9
+ // https://gist.github.com/kennykerr/15a62c8218254bc908de672e5ed405fa
10
+
11
+ extern "C"
12
+ {
13
+ HRESULT __stdcall CreateDirect3D11DeviceFromDXGIDevice(
14
+ ::IDXGIDevice* dxgiDevice, ::IInspectable** graphicsDevice);
15
+
16
+ HRESULT __stdcall CreateDirect3D11SurfaceFromDXGISurface(
17
+ ::IDXGISurface* dgxiSurface, ::IInspectable** graphicsSurface);
18
+ }
19
+
20
+ DEFINE_GUID(
21
+ IID__x_Windows_Graphics_DirectX_Direct3D11_IDirect3DDxgiInterfaceAccess,
22
+ // clang-format off
23
+ 0xA9B3D012, 0x3DF2, 0x4EE3, 0xB8, 0xD1, 0x86, 0x95, 0xF4, 0x57, 0xD3, 0xC1
24
+ // clang-format on
25
+ );
26
+
27
+ namespace Windows::Graphics::DirectX::Direct3D11
28
+ {
29
+ MIDL_INTERFACE("A9B3D012-3DF2-4EE3-B8D1-8695F457D3C1")
30
+ IDirect3DDxgiInterfaceAccess : ::IUnknown
31
+ {
32
+ virtual HRESULT STDMETHODCALLTYPE GetInterface(
33
+ REFIID riid, _COM_Outptr_ void** p) noexcept
34
+ = 0;
35
+ };
36
+ } // namespace Windows::Graphics::DirectX::Direct3D11
37
+
38
+ #ifdef __CRT_UUID_DECL
39
+ __CRT_UUID_DECL(
40
+ Windows::Graphics::DirectX::Direct3D11::IDirect3DDxgiInterfaceAccess,
41
+ // clang-format off
42
+ 0xA9B3D012, 0x3DF2, 0x4EE3, 0xB8, 0xD1, 0x86, 0x95, 0xF4, 0x57, 0xD3, 0xC1
43
+ // clang-format on
44
+ );
45
+ #endif
46
+ #endif
47
+
48
+ #include <winrt/Windows.Graphics.DirectX.Direct3D11.h>
49
+ #include "pybase.h"
50
+ #include "py.Windows.Graphics.DirectX.Direct3D11.h"
51
+
52
+ // https://learn.microsoft.com/en-us/windows/win32/api/windows.graphics.directx.direct3d11.interop/
53
+
54
+ namespace py::cpp::Windows::Graphics::DirectX::Direct3D11::Interop
55
+ {
56
+ static PyObject* create_direct3d11_device_from_dxgi_device(
57
+ PyObject* /*unused*/, PyObject* dxgi_device_obj) noexcept
58
+ {
59
+ try
60
+ {
61
+ auto dxgi_device
62
+ = reinterpret_cast<IDXGIDevice*>(PyLong_AsVoidPtr(dxgi_device_obj));
63
+
64
+ if (!dxgi_device && PyErr_Occurred())
65
+ {
66
+ return nullptr;
67
+ }
68
+
69
+ winrt::com_ptr<::IInspectable> d3d_device;
70
+ winrt::check_hresult(
71
+ CreateDirect3D11DeviceFromDXGIDevice(dxgi_device, d3d_device.put()));
72
+
73
+ return py::convert(
74
+ d3d_device.as<
75
+ winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice>());
76
+ }
77
+ catch (...)
78
+ {
79
+ py::to_PyErr();
80
+ return nullptr;
81
+ }
82
+ }
83
+
84
+ PyDoc_STRVAR(
85
+ create_direct3d11_device_from_dxgi_device_doc,
86
+ R"(Creates an instance of IDirect3DDevice from an IDXGIDevice.
87
+
88
+ Args:
89
+ dxgi_device (IDXGIDevice*): The IDXGIDevice to create the Direct3DDevice from.
90
+
91
+ Returns:
92
+ A Direct3DDevice instance that wraps the DXGIDevice.
93
+ )");
94
+
95
+ static PyObject* create_direct3d11_surface_from_dxgi_surface(
96
+ PyObject* /*unused*/, PyObject* dxgi_surface_obj) noexcept
97
+ {
98
+ try
99
+ {
100
+ auto dxgi_surface
101
+ = reinterpret_cast<IDXGISurface*>(PyLong_AsVoidPtr(dxgi_surface_obj));
102
+
103
+ if (!dxgi_surface && PyErr_Occurred())
104
+ {
105
+ return nullptr;
106
+ }
107
+
108
+ winrt::com_ptr<::IInspectable> d3d_surface;
109
+ winrt::check_hresult(CreateDirect3D11SurfaceFromDXGISurface(
110
+ dxgi_surface, d3d_surface.put()));
111
+
112
+ return py::convert(
113
+ d3d_surface.as<
114
+ winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface>());
115
+ }
116
+ catch (...)
117
+ {
118
+ py::to_PyErr();
119
+ return nullptr;
120
+ }
121
+ }
122
+
123
+ PyDoc_STRVAR(
124
+ create_direct3d11_surface_from_dxgi_surface_doc,
125
+ R"(Creates an instance of IDirect3DSurface from an IDXGISurface.
126
+
127
+ Args:
128
+ dxgi_surface (IDXGISurface*): The IDXGISurface to create the Direct3DSurface from.
129
+
130
+ Returns:
131
+ A Direct3DSurface instance that wraps the DXGISurface.
132
+ )");
133
+
134
+ static PyObject* get_dxgi_device_from_object(
135
+ PyObject* /*unused*/, PyObject* py_obj) noexcept
136
+ {
137
+ try
138
+ {
139
+ auto object
140
+ = py::convert_to<winrt::Windows::Foundation::IInspectable>(py_obj);
141
+ auto access = object.as<::Windows::Graphics::DirectX::Direct3D11::
142
+ IDirect3DDxgiInterfaceAccess>();
143
+ winrt::com_ptr<IDXGIDevice> result;
144
+ winrt::check_hresult(
145
+ access->GetInterface(winrt::guid_of<IDXGIDevice>(), result.put_void()));
146
+
147
+ return PyLong_FromVoidPtr(result.detach());
148
+ }
149
+ catch (...)
150
+ {
151
+ py::to_PyErr();
152
+ return nullptr;
153
+ }
154
+ }
155
+
156
+ static PyObject* get_dxgi_surface_from_object(
157
+ PyObject* /*unused*/, PyObject* py_obj) noexcept
158
+ {
159
+ try
160
+ {
161
+ auto object
162
+ = py::convert_to<winrt::Windows::Foundation::IInspectable>(py_obj);
163
+ auto access = object.as<::Windows::Graphics::DirectX::Direct3D11::
164
+ IDirect3DDxgiInterfaceAccess>();
165
+ winrt::com_ptr<IDXGISurface> result;
166
+ winrt::check_hresult(access->GetInterface(
167
+ winrt::guid_of<IDXGISurface>(), result.put_void()));
168
+
169
+ return PyLong_FromVoidPtr(result.detach());
170
+ }
171
+ catch (...)
172
+ {
173
+ py::to_PyErr();
174
+ return nullptr;
175
+ }
176
+ }
177
+
178
+ static PyMethodDef module_methods[]{
179
+ {"create_direct3d11_device_from_dxgi_device",
180
+ create_direct3d11_device_from_dxgi_device,
181
+ METH_O,
182
+ create_direct3d11_device_from_dxgi_device_doc},
183
+ {"create_direct3d11_surface_from_dxgi_surface",
184
+ create_direct3d11_surface_from_dxgi_surface,
185
+ METH_O,
186
+ create_direct3d11_surface_from_dxgi_surface_doc},
187
+ {"get_dxgi_device_from_object", get_dxgi_device_from_object, METH_O, nullptr},
188
+ {"get_dxgi_surface_from_object", get_dxgi_surface_from_object, METH_O, nullptr},
189
+ {}};
190
+
191
+ PyDoc_STRVAR(
192
+ module_doc,
193
+ "Interop functions for use with IDirect3DDevice and IDirect3DSurface.");
194
+
195
+ static PyModuleDef module_def
196
+ = {PyModuleDef_HEAD_INIT,
197
+ "_winrt_windows_graphics_directx_direct3d11_interop",
198
+ module_doc,
199
+ 0,
200
+ module_methods,
201
+ nullptr,
202
+ nullptr,
203
+ nullptr,
204
+ nullptr};
205
+ } // namespace py::cpp::Windows::Graphics::DirectX::Direct3D11::Interop
206
+
207
+ PyMODINIT_FUNC PyInit__winrt_windows_graphics_directx_direct3d11_interop(void) noexcept
208
+ {
209
+ using namespace py::cpp::Windows::Graphics::DirectX::Direct3D11::Interop;
210
+
211
+ if (py::import_winrt_runtime() == -1)
212
+ {
213
+ return nullptr;
214
+ }
215
+
216
+ return PyModule_Create(&module_def);
217
+ }
@@ -0,0 +1,45 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ [build-system]
4
+ requires = ["setuptools", "winrt-sdk"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "winrt-Windows.Graphics.DirectX.Direct3D11.Interop"
9
+ description = "Python projection of Windows Runtime (WinRT) APIs"
10
+ readme = "README.md"
11
+ license = { text = "MIT" }
12
+ classifiers = [
13
+ "Operating System :: Microsoft :: Windows",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: Implementation :: CPython",
16
+ "Intended Audience :: Developers",
17
+ ]
18
+ dynamic = ["version"]
19
+ requires-python = ">=3.9,<3.14"
20
+
21
+ [project.urls]
22
+ # Homepage = "https://github.com/pywinrt/pywinrt"
23
+ Documentation = "https://pywinrt.readthedocs.io"
24
+ Repository = "https://github.com/pywinrt/pywinrt"
25
+ Changelog = "https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md"
26
+
27
+ [tool.setuptools.dynamic]
28
+ version = { file = "pywinrt-version.txt" }
29
+
30
+ [tool.setuptools.package-data]
31
+ "*" = ["*.pyi", "py.typed"]
32
+
33
+ [tool.cibuildwheel]
34
+ # use local winrt-sdk build dependency
35
+ environment = { PYTHONPATH="../../winrt-sdk/src" }
36
+ # don't install winrt-sdk from PyPI
37
+ build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
38
+ before-build = "uv pip install setuptools"
39
+ # don't build for PyPy
40
+ skip = "pp*"
41
+ # suppress warnings about ARM64 testing
42
+ test-skip = "*-win_arm64"
43
+
44
+ [tool.cibuildwheel.windows]
45
+ archs = ["x86", "AMD64", "ARM64"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,31 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ from setuptools import Extension, setup
4
+ from setuptools.command.build_ext import build_ext
5
+ from winrt_sdk import get_include_dirs
6
+
7
+
8
+ class build_ext_ex(build_ext):
9
+ def build_extension(self, ext):
10
+ if self.compiler.compiler_type == "msvc":
11
+ ext.extra_compile_args = ["/std:c++20", "/permissive-"]
12
+ elif self.compiler.compiler_type == "mingw32":
13
+ ext.extra_compile_args = ["-std=c++20", "-D_WIN32_WINNT=_WIN32_WINNT_WIN10"]
14
+ ext.extra_link_args = ["-loleaut32"]
15
+ else:
16
+ raise ValueError(f"Unsupported compiler: {self.compiler.compiler_type}")
17
+
18
+ build_ext.build_extension(self, ext)
19
+
20
+
21
+ setup(
22
+ cmdclass = {'build_ext': build_ext_ex},
23
+ ext_modules=[
24
+ Extension(
25
+ "winrt._winrt_windows_graphics_directx_direct3d11_interop",
26
+ sources=["py.Windows.Graphics.DirectX.Direct3D11.Interop.cpp"],
27
+ include_dirs=get_include_dirs(),
28
+ libraries=["windowsapp", "D3D11"],
29
+ )
30
+ ],
31
+ )
@@ -0,0 +1,46 @@
1
+ from .windows.graphics.directx.direct3d11 import IDirect3DDevice
2
+ from .system import Object
3
+
4
+ def create_direct3d11_device_from_dxgi_device(dxgi_device: int) -> IDirect3DDevice:
5
+ """
6
+ Creates an instance of IDirect3DDevice from an IDXGIDevice.
7
+
8
+ Args:
9
+ dxgi_device (IDXGIDevice*): The IDXGIDevice to create the Direct3DDevice from.
10
+
11
+ Returns:
12
+ A Direct3DDevice instance that wraps the DXGIDevice.
13
+ """
14
+
15
+ def create_direct3d11_surface_from_dxgi_surface(dxgi_surface: int) -> int:
16
+ """
17
+ Creates an instance of IDirect3DSurface from an IDXGISurface.
18
+
19
+ Args:
20
+ dxgi_surface (IDXGISurface*): The IDXGISurface to create the Direct3DSurface from.
21
+
22
+ Returns:
23
+ Pointer to IDirect3DSurface interface of the IDXGISurface.
24
+ """
25
+
26
+ def get_dxgi_device_from_object(object: Object) -> int:
27
+ """
28
+ Retrieves the IDXGIDevice from a Direct3D object.
29
+
30
+ Args:
31
+ object: The WinRT object to retrieve the IDXGIDevice from.
32
+
33
+ Returns:
34
+ Pointer to IDXGIDevice interface of the WinRT object.
35
+ """
36
+
37
+ def get_dxgi_surface_from_object(object: Object) -> int:
38
+ """
39
+ Retrieves the IDXGISurface from a Direct3D object.
40
+
41
+ Args:
42
+ object: The WinRT object to retrieve the IDXGISurface from.
43
+
44
+ Returns:
45
+ Pointer to IDXGISurface interface of the WinRT object.
46
+ """
@@ -0,0 +1,17 @@
1
+ from ...... import _winrt_windows_graphics_directx_direct3d11_interop
2
+
3
+ __all__ = [
4
+ "create_direct3d11_device_from_dxgi_device",
5
+ "create_direct3d11_surface_from_dxgi_surface",
6
+ "get_dxgi_device_from_object",
7
+ "get_dxgi_surface_from_object",
8
+ ]
9
+
10
+ create_direct3d11_device_from_dxgi_device = _winrt_windows_graphics_directx_direct3d11_interop.create_direct3d11_device_from_dxgi_device
11
+ create_direct3d11_surface_from_dxgi_surface = _winrt_windows_graphics_directx_direct3d11_interop.create_direct3d11_surface_from_dxgi_surface
12
+ get_dxgi_device_from_object = (
13
+ _winrt_windows_graphics_directx_direct3d11_interop.get_dxgi_device_from_object
14
+ )
15
+ get_dxgi_surface_from_object = (
16
+ _winrt_windows_graphics_directx_direct3d11_interop.get_dxgi_surface_from_object
17
+ )
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Graphics.DirectX.Direct3D11.Interop
3
+ Version: 2.3.0
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Documentation, https://pywinrt.readthedocs.io
7
+ Project-URL: Repository, https://github.com/pywinrt/pywinrt
8
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: Implementation :: CPython
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: <3.14,>=3.9
14
+ Description-Content-Type: text/markdown
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Graphics.DirectX.Direct3D11.Interop
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Graphics.DirectX.Direct3D11.Interop` namespace.
21
+
22
+ This package provides the `winrt.windows.graphics.directx.direct3d11.interop` module.
@@ -0,0 +1,12 @@
1
+ README.md
2
+ py.Windows.Graphics.DirectX.Direct3D11.Interop.cpp
3
+ pyproject.toml
4
+ pywinrt-version.txt
5
+ setup.py
6
+ winrt/_winrt_windows_graphics_directx_direct3d11_interop.pyi
7
+ winrt/windows/graphics/directx/direct3d11/interop/__init__.py
8
+ winrt/windows/graphics/directx/direct3d11/interop/py.typed
9
+ winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/PKG-INFO
10
+ winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/SOURCES.txt
11
+ winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/dependency_links.txt
12
+ winrt_Windows.Graphics.DirectX.Direct3D11.Interop.egg-info/top_level.txt