├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── Directory.Build.props ├── Directory.Build.targets ├── Directory.Packages.props ├── LICENSE ├── NuGet.config ├── README.md ├── Vortice.Windows.sln ├── Vortice.snk ├── global.json ├── samples ├── AdvancedTextRenderingApp │ ├── AdvancedTextRenderingApp.csproj │ └── Program.cs ├── Directory.Build.props ├── HelloDirect3D11.Wpf │ ├── App.xaml │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── Assets │ │ └── Triangle.hlsl │ ├── HelloDirect3D11.Wpf.csproj │ ├── MainWindow.xaml │ └── MainWindow.xaml.cs ├── HelloDirect3D11 │ ├── Assets │ │ └── Triangle.hlsl │ ├── D3D11GraphicsDevice.cs │ ├── HelloDirect3D11.csproj │ └── Program.cs ├── HelloDirect3D12 │ ├── Assets │ │ ├── Common.hlsli │ │ └── Triangle.hlsl │ ├── D3D12GraphicsDevice.cs │ ├── HelloDirect3D12.csproj │ ├── PipelineStateStream.cs │ ├── Program.cs │ └── ShaderIncludeHandler.cs ├── HelloDirect3D12Raytracing │ ├── D3D12GraphicsDevice.cs │ ├── HelloDirect3D12Raytracing.csproj │ ├── Program.cs │ └── Shaders │ │ ├── Common.hlsl │ │ ├── Hit.hlsl │ │ ├── Miss.hlsl │ │ └── RayGen.hlsl ├── HelloDirectInput │ ├── DIInputDevice.cs │ ├── HelloDirectInput.csproj │ └── Program.cs ├── HelloDirectML │ ├── HelloDirectML.csproj │ ├── HelloDml.cs │ └── Program.cs ├── HelloDirectStorage │ ├── HelloDirectStorage.csproj │ ├── Program.cs │ └── Test.txt ├── HelloWinForms │ ├── HelloWinForms.csproj │ └── Program.cs ├── HelloXAudio2 │ ├── Assets │ │ ├── AssetInfo.txt │ │ └── SpaceVehicleFlyby.wav │ ├── HelloXAudio2.csproj │ └── Program.cs ├── MediaFoundation │ ├── AudioPlay │ │ ├── AudioPlay.csproj │ │ ├── Program.cs │ │ └── ergon.wav │ └── EnumerateDevices │ │ ├── EnumerateDevices.csproj │ │ └── Program.cs ├── Vortice.SampleFramework │ ├── Application.cs │ ├── Enums.cs │ ├── IGraphicsDevice.cs │ ├── NativeMethods.json │ ├── NativeMethods.txt │ ├── Platforms │ │ ├── NetStandard │ │ │ ├── Application.cs │ │ │ └── Window.cs │ │ └── UWP │ │ │ ├── Application.cs │ │ │ └── Window.cs │ ├── ShaderCompiler.cs │ ├── VertexPositionColor.cs │ ├── Vortice.SampleFramework.csproj │ └── Window.cs └── XInput │ ├── HelloXInput.csproj │ └── Program.cs ├── src ├── Vortice.D3DCompiler │ ├── Compiler.cs │ ├── Mappings.xml │ └── Vortice.D3DCompiler.csproj ├── Vortice.DXGI │ ├── DXGI.cs │ ├── Debug │ │ ├── IDXGIInfoQueue.cs │ │ ├── InfoQueueFilter.cs │ │ └── InfoQueueFilterDescription.cs │ ├── Documentation.xml │ ├── IDXGIAdapter.cs │ ├── IDXGIDecodeSwapChain.cs │ ├── IDXGIDevice.cs │ ├── IDXGIDevice1.cs │ ├── IDXGIDeviceSubObject.cs │ ├── IDXGIFactory2.cs │ ├── IDXGIFactory4.cs │ ├── IDXGIFactory5.cs │ ├── IDXGIFactory6.cs │ ├── IDXGIFactory7.cs │ ├── IDXGIFactoryMedia.cs │ ├── IDXGIObject.cs │ ├── IDXGIOutput.cs │ ├── IDXGIOutput1.cs │ ├── IDXGIOutput3.cs │ ├── IDXGIOutput4.cs │ ├── IDXGIOutput5.cs │ ├── IDXGIOutputDuplication.cs │ ├── IDXGISurface.cs │ ├── IDXGISurface2.cs │ ├── IDXGISwapChain.cs │ ├── IDXGISwapChain1.cs │ ├── IDXGISwapChain2.cs │ ├── IDXGISwapChain3.cs │ ├── IDXGISwapChain4.cs │ ├── IVirtualSurfaceImageSourceNative.cs │ ├── IVirtualSurfaceUpdatesCallbackNative.cs │ ├── Mappings.xml │ ├── PresentParameters.cs │ ├── SwapChainDescription1.cs │ └── Vortice.DXGI.csproj ├── Vortice.Direct2D1 │ ├── ArcSegment.cs │ ├── BezierSegment.cs │ ├── BitmapBrushProperties.cs │ ├── BitmapBrushProperties1.cs │ ├── BitmapProperties.cs │ ├── BitmapProperties1.cs │ ├── BlendDescription.cs │ ├── BrushProperties.cs │ ├── CustomEffectAttribute.cs │ ├── CustomEffectBase.cs │ ├── CustomEffectFactory.cs │ ├── CustomEffectPropertyAttribute.cs │ ├── CustomVertexBufferProperties.cs │ ├── D2D1.cs │ ├── DirectWrite │ │ ├── ColorGlyphRun.cs │ │ ├── ColorGlyphRun1.cs │ │ ├── DWrite.cs │ │ ├── GlyphRun.cs │ │ ├── GlyphRunDescription.cs │ │ ├── IDWriteColorGlyphRunEnumerator.cs │ │ ├── IDWriteColorGlyphRunEnumerator1.cs │ │ ├── IDWriteFactory.cs │ │ ├── IDWriteFactory2.cs │ │ ├── IDWriteFactory4.cs │ │ ├── IDWriteFontFace.cs │ │ ├── IDWriteFontFile.cs │ │ ├── IDWriteGdiInterop.cs │ │ ├── IDWriteGdiInterop1.cs │ │ ├── IDWriteLocalizedStrings.cs │ │ ├── IDWriteTextFormat.cs │ │ ├── IDWriteTextLayout.cs │ │ ├── TextRange.cs │ │ └── TextRendererBase.cs │ ├── Documentation.xml │ ├── Effects │ │ ├── AffineTransform2D.cs │ │ ├── AlphaMask.cs │ │ ├── ArithmeticComposite.cs │ │ ├── Atlas.cs │ │ ├── BitmapSource.cs │ │ ├── Blend.cs │ │ ├── Border.cs │ │ ├── Brightness.cs │ │ ├── ChromaKey.cs │ │ ├── ColorManagement.cs │ │ ├── ColorMatrix.cs │ │ ├── Composite.cs │ │ ├── Contrast.cs │ │ ├── ConvolveMatrix.cs │ │ ├── Crop.cs │ │ ├── CrossFade.cs │ │ ├── DirectionalBlur.cs │ │ ├── DiscreteTransfer.cs │ │ ├── DisplacementMap.cs │ │ ├── DistantDiffuse.cs │ │ ├── DistantSpecular.cs │ │ ├── DpiCompensation.cs │ │ ├── EdgeDetection.cs │ │ ├── Emboss.cs │ │ ├── Exposure.cs │ │ ├── Flood.cs │ │ ├── GammaTransfer.cs │ │ ├── GaussianBlur.cs │ │ ├── Grayscale.cs │ │ ├── HdrToneMap.cs │ │ ├── HighlightsAndShadows.cs │ │ ├── Histogram.cs │ │ ├── HueRotation.cs │ │ ├── HueToRgb.cs │ │ ├── Invert.cs │ │ ├── LinearTransfer.cs │ │ ├── LookupTable3D.cs │ │ ├── LuminanceToAlpha.cs │ │ ├── Morphology.cs │ │ ├── Opacity.cs │ │ ├── OpacityMetadata.cs │ │ ├── PerspectiveTransform3D.cs │ │ ├── PointDiffuse.cs │ │ ├── PointSpecular.cs │ │ ├── Posterize.cs │ │ ├── Premultiply.cs │ │ ├── RgbToHue.cs │ │ ├── Saturation.cs │ │ ├── Scale.cs │ │ ├── Sepia.cs │ │ ├── Shadow.cs │ │ ├── Sharpen.cs │ │ ├── SpotDiffuse.cs │ │ ├── SpotSpecular.cs │ │ ├── Straighten.cs │ │ ├── TableTransfer.cs │ │ ├── TemperatureAndTint.cs │ │ ├── Tile.cs │ │ ├── Tint.cs │ │ ├── Transform3D.cs │ │ ├── Turbulence.cs │ │ ├── Unpremultiply.cs │ │ ├── Vignette.cs │ │ ├── WhiteLevelAdjustment.cs │ │ └── YCbCr.cs │ ├── Ellipse.cs │ ├── Gdi │ │ ├── FontSignature.cs │ │ └── LogFont.cs │ ├── GradientStop.cs │ ├── ID2D1Bitmap.cs │ ├── ID2D1Bitmap1.cs │ ├── ID2D1ColorContext.cs │ ├── ID2D1CommandSink.cs │ ├── ID2D1Device.cs │ ├── ID2D1DeviceContext.cs │ ├── ID2D1DrawInfo.cs │ ├── ID2D1Effect.cs │ ├── ID2D1EffectContext.cs │ ├── ID2D1Factory.cs │ ├── ID2D1Factory1.cs │ ├── ID2D1Geometry.cs │ ├── ID2D1GeometryGroup.cs │ ├── ID2D1Properties.cs │ ├── ID2D1RenderTarget.cs │ ├── ID2D1SimplifiedGeometrySink.cs │ ├── ID2D1SvgElement.cs │ ├── ID2D1TessellationSink.cs │ ├── ID2D1TransformNode.cs │ ├── ImageBrushProperties.cs │ ├── InputElementDescription.cs │ ├── LinearGradientBrushProperties.cs │ ├── Mappings.xml │ ├── NativeFileAccess.cs │ ├── RadialGradientBrushProperties.cs │ ├── RenderTargetProperties.cs │ ├── RoundedRectangle.cs │ ├── SvgLength.cs │ ├── SvgPreserveAspectRatio.cs │ ├── SvgViewbox.cs │ ├── Triangle.cs │ ├── VertexBufferProperties.cs │ ├── VertexRange.cs │ ├── Vortice.Direct2D1.csproj │ └── WIC │ │ ├── ColorContextsHelper.cs │ │ ├── ContainerFormat.cs │ │ ├── IWICBitmap.cs │ │ ├── IWICBitmapDecoder.cs │ │ ├── IWICBitmapDecoderInfo.cs │ │ ├── IWICBitmapEncoder.cs │ │ ├── IWICBitmapFrameDecode.cs │ │ ├── IWICBitmapFrameEncode.cs │ │ ├── IWICBitmapLock.cs │ │ ├── IWICBitmapSource.cs │ │ ├── IWICColorContext.cs │ │ ├── IWICFormatConverter.cs │ │ ├── IWICImageEncoder.cs │ │ ├── IWICImagingFactory.cs │ │ ├── IWICImagingFactory2.cs │ │ ├── IWICPalette.cs │ │ ├── IWICStream.cs │ │ ├── PixelFormat.cs │ │ └── WIC.cs ├── Vortice.Direct3D11 │ ├── BlendDescription.cs │ ├── BlendDescription1.cs │ ├── BufferDescription.cs │ ├── CounterDescription.cs │ ├── D3D11.Interop.cs │ ├── D3D11.cs │ ├── Debug │ │ ├── ID3D11InfoQueue.cs │ │ ├── InfoQueueFilter.cs │ │ ├── InfoQueueFilterDescription.cs │ │ └── Message.cs │ ├── DepthStencilDescription.cs │ ├── DepthStencilOperationDescription.cs │ ├── DepthStencilViewDescription.cs │ ├── Direct3D11on12 │ │ ├── Apis.cs │ │ ├── ID3D11On12Device.cs │ │ ├── ID3D11On12Device1.cs │ │ └── ID3D11On12Device2.cs │ ├── Documentation.xml │ ├── ID3D11Buffer.cs │ ├── ID3D11CommandList.cs │ ├── ID3D11Device.cs │ ├── ID3D11Device1.cs │ ├── ID3D11Device2.cs │ ├── ID3D11Device3.cs │ ├── ID3D11Device4.cs │ ├── ID3D11Device5.cs │ ├── ID3D11DeviceChild.cs │ ├── ID3D11DeviceContext.cs │ ├── ID3D11DeviceContext1.cs │ ├── ID3D11DeviceContext2.cs │ ├── ID3D11DeviceContext3.cs │ ├── ID3D11Fence.cs │ ├── ID3D11Resource.cs │ ├── ID3D11Texture1D.cs │ ├── ID3D11Texture2D.cs │ ├── ID3D11Texture3D.cs │ ├── ID3D11VideoContext.cs │ ├── ID3D11VideoDecoder.cs │ ├── ID3D11VideoDevice.cs │ ├── ID3D11VideoDevice1.cs │ ├── ID3D11VideoDevice2.cs │ ├── ID3D11VideoProcessorEnumerator.cs │ ├── IDirect3DDxgiInterfaceAccess.cs │ ├── InputElementDescription.cs │ ├── MappedSubresource.cs │ ├── Mappings.xml │ ├── QueryDescription.cs │ ├── QueryDescription1.cs │ ├── RasterizerDescription.cs │ ├── RasterizerDescription1.cs │ ├── RasterizerDescription2.cs │ ├── RenderTargetBlendDescription.cs │ ├── RenderTargetBlendDescription1.cs │ ├── RenderTargetViewDescription.cs │ ├── RenderTargetViewDescription1.cs │ ├── SamplerDescription.cs │ ├── Shader │ │ ├── ID3D11ShaderReflection.cs │ │ ├── ID3D11ShaderReflectionConstantBuffer.cs │ │ ├── RegisterComponentMaskFlags.cs │ │ └── ShaderDescription.cs │ ├── ShaderResourceViewDescription.cs │ ├── ShaderResourceViewDescription1.cs │ ├── SharedResourceFlags.cs │ ├── SubresourceData.cs │ ├── Texture1DDescription.cs │ ├── Texture2DDescription.cs │ ├── Texture2DDescription1.cs │ ├── Texture3DDescription.cs │ ├── Texture3DDescription1.cs │ ├── TileRegionSize.cs │ ├── TiledResourceCoordinate.cs │ ├── UnorderedAccessViewDescription.cs │ ├── UnorderedAccessViewDescription1.cs │ ├── VideoProcessorColorSpace.cs │ └── Vortice.Direct3D11.csproj ├── Vortice.Direct3D12 │ ├── AutoBreadcrumbNode.cs │ ├── AutoBreadcrumbNode1.cs │ ├── BarrierGroup.cs │ ├── BlendDescription.cs │ ├── BuildRaytracingAccelerationStructureDescription.cs │ ├── BuildRaytracingAccelerationStructureInputs.cs │ ├── ClearValue.cs │ ├── CommandQueueDescription.cs │ ├── CommandSignatureDescription.cs │ ├── ComputePipelineStateDescription.cs │ ├── ConstantBufferViewDescription.cs │ ├── Constants.cs │ ├── CpuDescriptorHandle.cs │ ├── D3D12.cs │ ├── Debug │ │ ├── ID3D12InfoQueue.cs │ │ ├── ID3D12InfoQueue1.cs │ │ ├── InfoQueueFilter.cs │ │ ├── InfoQueueFilterDescription.cs │ │ └── Message.cs │ ├── DepthStencilDescription.cs │ ├── DepthStencilDescription1.cs │ ├── DepthStencilDescription2.cs │ ├── DepthStencilOperationDescription.cs │ ├── DepthStencilOperationDescription1.cs │ ├── DepthStencilValue.cs │ ├── DescriptorHeapDescription.cs │ ├── DescriptorRange.cs │ ├── DescriptorRange1.cs │ ├── DispatchArguments.cs │ ├── DispatchGraphDescription.cs │ ├── DispatchRaysDescription.cs │ ├── Documentation.xml │ ├── DrawArguments.cs │ ├── DrawIndexedArguments.cs │ ├── DredAllocationNode.cs │ ├── DredAllocationNode1.cs │ ├── DredAutoBreadcrumbsOutput.cs │ ├── DredAutoBreadcrumbsOutput1.cs │ ├── DredPageFaultOutput.cs │ ├── DredPageFaultOutput1.cs │ ├── DxilLibraryDescription.cs │ ├── DxilSubObjectToExportsAssociation.cs │ ├── ExistingCollectionDescription.cs │ ├── ExportDescription.cs │ ├── GlobalBarrier.cs │ ├── GlobalRootSignature.cs │ ├── GpuDescriptorHandle.cs │ ├── GpuVirtualAddressAndStride.cs │ ├── GpuVirtualAddressRange.cs │ ├── GpuVirtualAddressRangeAndStride.cs │ ├── GraphicsPipelineStateDescription.cs │ ├── HeapDescription.cs │ ├── HeapProperties.cs │ ├── HitGroupDescription.cs │ ├── ID3D12CommandQueue.cs │ ├── ID3D12DSRDeviceFactory.cs │ ├── ID3D12DescriptorHeap.cs │ ├── ID3D12Device.cs │ ├── ID3D12Device1.cs │ ├── ID3D12Device10.cs │ ├── ID3D12Device11.cs │ ├── ID3D12Device2.cs │ ├── ID3D12Device3.cs │ ├── ID3D12Device4.cs │ ├── ID3D12Device5.cs │ ├── ID3D12Device7.cs │ ├── ID3D12Device8.cs │ ├── ID3D12Device9.cs │ ├── ID3D12DeviceChild.cs │ ├── ID3D12DeviceConfiguration.cs │ ├── ID3D12DeviceFactory.cs │ ├── ID3D12Fence.cs │ ├── ID3D12GraphicsCommandList.cs │ ├── ID3D12GraphicsCommandList1.cs │ ├── ID3D12GraphicsCommandList2.cs │ ├── ID3D12GraphicsCommandList4.cs │ ├── ID3D12GraphicsCommandList7.cs │ ├── ID3D12Object.cs │ ├── ID3D12PipelineLibrary.cs │ ├── ID3D12PipelineLibrary1.cs │ ├── ID3D12ProtectedSession.cs │ ├── ID3D12Resource.cs │ ├── ID3D12Resource1.cs │ ├── ID3D12SDKConfiguration1.cs │ ├── ID3D12VersionedRootSignatureDeserializer.cs │ ├── IStateSubObjectDescription.cs │ ├── IndexBufferView.cs │ ├── InputElementDescription.cs │ ├── InputLayoutDescription.cs │ ├── LocalRootSignature.cs │ ├── Mappings.xml │ ├── MipRegion.cs │ ├── NodeMask.cs │ ├── PipelineStateStreamSubObject.cs │ ├── PixHelpers.cs │ ├── ProtectedResourceSessionDescription.cs │ ├── QueryHeapDescription.cs │ ├── Range.cs │ ├── RangeUInt64.cs │ ├── RasterizerDescription.cs │ ├── RasterizerDescription1.cs │ ├── RasterizerDescription2.cs │ ├── RaytracingGeometryAabbsDescription.cs │ ├── RaytracingGeometryDescription.cs │ ├── RaytracingGeometryTrianglesDescription.cs │ ├── RaytracingInstanceDescription.cs │ ├── RaytracingPipelineConfig.cs │ ├── RaytracingPipelineConfig1.cs │ ├── RaytracingShaderConfig.cs │ ├── RenderPassBeginningAccess.cs │ ├── RenderPassBeginningAccessClearParameters.cs │ ├── RenderPassDepthStencilDescription.cs │ ├── RenderPassEndingAccess.cs │ ├── RenderPassEndingAccessResolveParameters.cs │ ├── RenderPassEndingAccessResolveSubresourceParameters.cs │ ├── RenderPassRenderTargetDescription.cs │ ├── RenderTargetBlendDescription.cs │ ├── ResourceAliasingBarrier.cs │ ├── ResourceAllocationInfo.cs │ ├── ResourceBarrier.cs │ ├── ResourceDescription.cs │ ├── ResourceDescription1.cs │ ├── ResourceTransitionBarrier.cs │ ├── ResourceUnorderedAccessViewBarrier.cs │ ├── RootConstants.cs │ ├── RootDescriptor.cs │ ├── RootDescriptor1.cs │ ├── RootDescriptorTable.cs │ ├── RootDescriptorTable1.cs │ ├── RootParameter.cs │ ├── RootParameter1.cs │ ├── RootSignatureDescription.cs │ ├── RootSignatureDescription1.cs │ ├── RootSignatureDescription2.cs │ ├── RtFormatArray.cs │ ├── SamplePosition.cs │ ├── SamplerDescription.cs │ ├── Shader │ │ ├── ID3D12ShaderReflection.cs │ │ ├── ID3D12ShaderReflectionConstantBuffer.cs │ │ ├── RegisterComponentMaskFlags.cs │ │ └── ShaderDescription.cs │ ├── ShaderBytecode.cs │ ├── ShaderComponentMapping.cs │ ├── ShaderNode.cs │ ├── StateObjectConfig.cs │ ├── StateObjectDescription.cs │ ├── StateSubObject.cs │ ├── StaticSamplerDescription.cs │ ├── StaticSamplerDescription1.cs │ ├── StreamOutputDescription.cs │ ├── SubObjectToExportsAssociation.cs │ ├── SubresourceData.cs │ ├── SubresourceFootPrint.cs │ ├── TextureCopyLocation.cs │ ├── TileRegionSize.cs │ ├── TiledResourceCoordinate.cs │ ├── VersionedDeviceRemovedExtendedData.cs │ ├── VersionedRootSignatureDescription.cs │ ├── VertexBufferView.cs │ ├── Video │ │ ├── ID3D12VideoDecodeCommandList.cs │ │ ├── ID3D12VideoDecoder1.cs │ │ ├── ID3D12VideoDecoderHeap1.cs │ │ ├── ID3D12VideoDevice.cs │ │ ├── ID3D12VideoDevice1.cs │ │ ├── ID3D12VideoDevice2.cs │ │ ├── ID3D12VideoEncodeCommandList.cs │ │ ├── ID3D12VideoExtensionCommand.cs │ │ ├── ID3D12VideoMotionEstimator.cs │ │ ├── ID3D12VideoMotionVectorHeap.cs │ │ ├── ID3D12VideoProcessCommandList.cs │ │ ├── ID3D12VideoProcessor.cs │ │ ├── ID3D12VideoProcessor1.cs │ │ ├── VideoDecodeOutputStreamArguments1.cs │ │ ├── VideoEncoderAV1CodecConfigurationSupport.cs │ │ ├── VideoEncoderAv1ReferencePictureWarpedMotionInfo.cs │ │ ├── VideoEncoderAv1SegmentData.cs │ │ ├── VideoEncoderProfileDescription.cs │ │ ├── VideoProcessAlphaBlending.cs │ │ ├── VideoProcessInputStreamArguments.cs │ │ ├── VideoProcessInputStreamArguments1.cs │ │ ├── VideoProcessOutputStreamArguments.cs │ │ └── VideoProcessTransform.cs │ ├── ViewInstanceLocation.cs │ ├── ViewInstancingDescription.cs │ ├── Vortice.Direct3D12.csproj │ └── WriteBufferImmediateParameter.cs ├── Vortice.Direct3D9 │ ├── AdapterIdentifier.cs │ ├── D3D9.cs │ ├── Direct3D9on12 │ │ ├── Apis.cs │ │ ├── D3D9On12Arguments.cs │ │ └── IDirect3DDevice9On12.cs │ ├── Documentation.xml │ ├── Helpers.cs │ ├── IDirect3D9.cs │ ├── IDirect3D9Ex.cs │ ├── IDirect3DCubeTexture9.cs │ ├── IDirect3DDevice9.cs │ ├── IDirect3DDevice9Ex.cs │ ├── IDirect3DIndexBuffer9.cs │ ├── IDirect3DQuery9.cs │ ├── IDirect3DResource9.cs │ ├── IDirect3DSurface9.cs │ ├── IDirect3DSwapChain9.cs │ ├── IDirect3DTexture9.cs │ ├── IDirect3DVertexBuffer9.cs │ ├── IDirect3DVertexDeclaration9.cs │ ├── IDirect3DVolume9.cs │ ├── IDirect3DVolumeTexture9.cs │ ├── LARGE_INTEGER.cs │ ├── Luid.cs │ ├── Mappings.xml │ ├── PaletteEntry.cs │ ├── Rect.cs │ ├── VertexElement.cs │ └── Vortice.Direct3D9.csproj ├── Vortice.DirectComposition │ ├── DComp.cs │ ├── Documentation.xml │ ├── IDCompositionDesktopDevice.cs │ ├── IDCompositionDevice.cs │ ├── IDCompositionDevice2.cs │ ├── IDCompositionDevice3.cs │ ├── IDCompositionSurface.cs │ ├── IDCompositionSurfaceFactory.cs │ ├── IDCompositionVisual.cs │ ├── IDCompositionVisual3.cs │ ├── Mappings.xml │ └── Vortice.DirectComposition.csproj ├── Vortice.DirectInput │ ├── Attributes.cs │ ├── Capabilities.cs │ ├── ConditionSet.cs │ ├── ConstantForce.cs │ ├── CustomForce.cs │ ├── DInput.cs │ ├── DataFormat.cs │ ├── DataObjectFormat.cs │ ├── DeviceImageHeader.cs │ ├── DeviceInstance.cs │ ├── DeviceObjectId.cs │ ├── DeviceObjectInstance.cs │ ├── EffectFile.cs │ ├── EffectInfo.cs │ ├── EffectParameters.cs │ ├── EnumCreatedEffectsCallback.cs │ ├── EnumDevicesCallback.cs │ ├── EnumEffectsCallback.cs │ ├── EnumEffectsInFileCallback.cs │ ├── EnumObjectsCallback.cs │ ├── Envelope.cs │ ├── IDataFormatProvider.cs │ ├── IDeviceState.cs │ ├── IDirectInput8.cs │ ├── IDirectInputDevice8.cs │ ├── IDirectInputEffect.cs │ ├── IStateUpdate.cs │ ├── InputRange.cs │ ├── JoystickOffset.cs │ ├── JoystickState.cs │ ├── JoystickUpdate.cs │ ├── KeyboardState.cs │ ├── KeyboardUpdate.cs │ ├── Mappings.xml │ ├── MouseOffset.cs │ ├── MouseState.cs │ ├── MouseUpdate.cs │ ├── ObjectDataFormatFlags.cs │ ├── ObjectGuid.cs │ ├── ObjectProperties.cs │ ├── PeriodicForce.cs │ ├── PredefinedDevice.cs │ ├── PropertyAccessor.cs │ ├── PropertyGuids.cs │ ├── RampForce.cs │ ├── RawJoystickState.cs │ ├── RawKeyboardState.cs │ ├── RawMouseState.cs │ ├── ResultCode.cs │ ├── TypeSpecificParameters.cs │ └── Vortice.DirectInput.csproj ├── Vortice.DirectML │ ├── ActivationCeluOperatorDescription.cs │ ├── ActivationEluOperatorDescription.cs │ ├── ActivationHardSigmoidOperatorDescription.cs │ ├── ActivationHardmaxOperatorDescription.cs │ ├── ActivationIdentityOperatorDescription.cs │ ├── ActivationLeakyReluOperatorDescription.cs │ ├── ActivationLinearOperatorDescription.cs │ ├── ActivationLogSoftmaxOperatorDescription.cs │ ├── ActivationParameterizedReluOperatorDescription.cs │ ├── ActivationParametricSoftplusOperatorDescription.cs │ ├── ActivationReluGradOperatorDescription.cs │ ├── ActivationReluOperatorDescription.cs │ ├── ActivationScaledEluOperatorDescription.cs │ ├── ActivationScaledTanhOperatorDescription.cs │ ├── ActivationShrinkOperatorDescription.cs │ ├── ActivationSigmoidOperatorDescription.cs │ ├── ActivationSoftmaxOperatorDescription.cs │ ├── ActivationSoftplusOperatorDescription.cs │ ├── ActivationSoftsignOperatorDescription.cs │ ├── ActivationTanhOperatorDescription.cs │ ├── ActivationThresholdedReluOperatorDescription.cs │ ├── AdamOptimizerOperatorDescription.cs │ ├── ArgmaxOperatorDescription.cs │ ├── ArgminOperatorDescription.cs │ ├── AveragePoolingGradOperatorDescription.cs │ ├── AveragePoolingOperatorDescription.cs │ ├── BatchNormalizationGradOperatorDescription.cs │ ├── BatchNormalizationOperatorDescription.cs │ ├── BatchNormalizationTrainingGradOperatorDescription.cs │ ├── BatchNormalizationTrainingOperatorDescription.cs │ ├── BindingDescription.cs │ ├── BufferArrayBinding.cs │ ├── BufferBinding.cs │ ├── BufferTensorDescription.cs │ ├── CastOperatorDescription.cs │ ├── ConvolutionIntegerOperatorDescription.cs │ ├── ConvolutionOperatorDescription.cs │ ├── CumulativeProductOperatorDescription.cs │ ├── CumulativeSummationOperatorDescription.cs │ ├── DML.cs │ ├── DepthToSpace1OperatorDescription.cs │ ├── DepthToSpaceOperatorDescription.cs │ ├── DiagonalMatrixOperatorDescription.cs │ ├── Documentation.xml │ ├── DynamicQuantizeLinearOperatorDescription.cs │ ├── ElementWiseAbsOperatorDescription.cs │ ├── ElementWiseAcosOperatorDescription.cs │ ├── ElementWiseAcoshOperatorDescription.cs │ ├── ElementWiseAdd1OperatorDescription.cs │ ├── ElementWiseAddOperatorDescription.cs │ ├── ElementWiseAsinOperatorDescription.cs │ ├── ElementWiseAsinhOperatorDescription.cs │ ├── ElementWiseAtanOperatorDescription.cs │ ├── ElementWiseAtanYXOperatorDescription.cs │ ├── ElementWiseAtanhOperatorDescription.cs │ ├── ElementWiseBitAndOperatorDescription.cs │ ├── ElementWiseBitCountOperatorDescription.cs │ ├── ElementWiseBitNotOperatorDescription.cs │ ├── ElementWiseBitOrOperatorDescription.cs │ ├── ElementWiseBitShiftLeftOperatorDescription.cs │ ├── ElementWiseBitShiftRightOperatorDescription.cs │ ├── ElementWiseBitXorOperatorDescription.cs │ ├── ElementWiseCeilOperatorDescription.cs │ ├── ElementWiseClip1OperatorDescription.cs │ ├── ElementWiseClipGrad1OperatorDescription.cs │ ├── ElementWiseClipGradOperatorDescription.cs │ ├── ElementWiseClipOperatorDescription.cs │ ├── ElementWiseConstantPowOperatorDescription.cs │ ├── ElementWiseCosOperatorDescription.cs │ ├── ElementWiseCoshOperatorDescription.cs │ ├── ElementWiseDequantizeLinearOperatorDescription.cs │ ├── ElementWiseDifferenceSquareOperatorDescription.cs │ ├── ElementWiseDivideOperatorDescription.cs │ ├── ElementWiseErfOperatorDescription.cs │ ├── ElementWiseExpOperatorDescription.cs │ ├── ElementWiseFloorOperatorDescription.cs │ ├── ElementWiseIdentityOperatorDescription.cs │ ├── ElementWiseIfOperatorDescription.cs │ ├── ElementWiseIsInfinityOperatorDescription.cs │ ├── ElementWiseIsNanOperatorDescription.cs │ ├── ElementWiseLogOperatorDescription.cs │ ├── ElementWiseLogicalAndOperatorDescription.cs │ ├── ElementWiseLogicalEqualsOperatorDescription.cs │ ├── ElementWiseLogicalGreaterThanOperatorDescription.cs │ ├── ElementWiseLogicalGreaterThanOrEqualOperatorDescription.cs │ ├── ElementWiseLogicalLessThanOperatorDescription.cs │ ├── ElementWiseLogicalLessThanOrEqualOperatorDescription.cs │ ├── ElementWiseLogicalNotOperatorDescription.cs │ ├── ElementWiseLogicalOrOperatorDescription.cs │ ├── ElementWiseLogicalXorOperatorDescription.cs │ ├── ElementWiseMaxOperatorDescription.cs │ ├── ElementWiseMeanOperatorDescription.cs │ ├── ElementWiseMinOperatorDescription.cs │ ├── ElementWiseModulusFloorOperatorDescription.cs │ ├── ElementWiseModulusTruncateOperatorDescription.cs │ ├── ElementWiseMultiplyOperatorDescription.cs │ ├── ElementWiseNegateOperatorDescription.cs │ ├── ElementWisePowOperatorDescription.cs │ ├── ElementWiseQuantizeLinearOperatorDescription.cs │ ├── ElementWiseQuantizedLinearAddOperatorDescription.cs │ ├── ElementWiseRecipOperatorDescription.cs │ ├── ElementWiseRoundOperatorDescription.cs │ ├── ElementWiseSignOperatorDescription.cs │ ├── ElementWiseSinOperatorDescription.cs │ ├── ElementWiseSinhOperatorDescription.cs │ ├── ElementWiseSqrtOperatorDescription.cs │ ├── ElementWiseSubtractOperatorDescription.cs │ ├── ElementWiseTanOperatorDescription.cs │ ├── ElementWiseTanhOperatorDescription.cs │ ├── ElementWiseThresholdOperatorDescription.cs │ ├── FillValueConstantOperatorDescription.cs │ ├── FillValueSequenceOperatorDescription.cs │ ├── GatherElementsOperatorDescription.cs │ ├── GatherNd1OperatorDescription.cs │ ├── GatherNdOperatorDescription.cs │ ├── GatherOperatorDescription.cs │ ├── GeneralMatrixMultiplyOperatorDescription.cs │ ├── GraphDescription.cs │ ├── GraphEdgeDescription.cs │ ├── GraphNodeDescription.cs │ ├── GruOperatorDescription.cs │ ├── IBindingDescription.cs │ ├── IDMLBindingTable.cs │ ├── IDMLDevice.cs │ ├── IDMLDevice1.cs │ ├── IDMLOperatorInitializer.cs │ ├── IGraphEdgeDescription.cs │ ├── IGraphNodeDescription.cs │ ├── IOperatorDescription.cs │ ├── ITensorDescription.cs │ ├── InputGraphEdgeDescription.cs │ ├── IntermediateGraphEdgeDescription.cs │ ├── JoinOperatorDescription.cs │ ├── LocalResponseNormalizationGradientOperatorDescription.cs │ ├── LocalResponseNormalizationOperatorDescription.cs │ ├── LpNormalizationOperatorDescription.cs │ ├── LpPoolingOperatorDescription.cs │ ├── LstmOperatorDescription.cs │ ├── Mappings.xml │ ├── MatrixMultiplyIntegerOperatorDescription.cs │ ├── MaxPooling1OperatorDescription.cs │ ├── MaxPooling2OperatorDescription.cs │ ├── MaxPoolingGradOperatorDescription.cs │ ├── MaxPoolingOperatorDescription.cs │ ├── MaxUnpoolingOperatorDescription.cs │ ├── MeanVarianceNormalization1OperatorDescription.cs │ ├── MeanVarianceNormalizationOperatorDescription.cs │ ├── NonzeroCoordinatesOperatorDescription.cs │ ├── OneHotOperatorDescription.cs │ ├── OperatorDescription.cs │ ├── OperatorGraphNodeDescription.cs │ ├── OutputGraphEdgeDescription.cs │ ├── Padding1OperatorDescription.cs │ ├── PaddingOperatorDescription.cs │ ├── QuantizedLinearConvolutionOperatorDescription.cs │ ├── QuantizedLinearMatrixMultiplyOperatorDescription.cs │ ├── RandomGeneratorOperatorDescription.cs │ ├── ReduceOperatorDescription.cs │ ├── Resample1OperatorDescription.cs │ ├── ResampleGradOperatorDescription.cs │ ├── ResampleOperatorDescription.cs │ ├── ReverseSubsequencesOperatorDescription.cs │ ├── RnnOperatorDescription.cs │ ├── RoiAlign1OperatorDescription.cs │ ├── RoiAlignGradOperatorDescription.cs │ ├── RoiAlignOperatorDescription.cs │ ├── RoiPoolingOperatorDescription.cs │ ├── ScalarUnion.cs │ ├── ScaleBias.cs │ ├── ScatterNdOperatorDescription.cs │ ├── ScatterOperatorDescription.cs │ ├── Size2D.cs │ ├── Slice1OperatorDescription.cs │ ├── SliceGradOperatorDescription.cs │ ├── SliceOperatorDescription.cs │ ├── SpaceToDepth1OperatorDescription.cs │ ├── SpaceToDepthOperatorDescription.cs │ ├── SplitOperatorDescription.cs │ ├── TensorDescription.cs │ ├── TileOperatorDescription.cs │ ├── TopK1OperatorDescription.cs │ ├── TopKOperatorDescription.cs │ ├── Upsample2DOperatorDescription.cs │ ├── ValueScale2DOperatorDescription.cs │ ├── Vortice.DirectML.csproj │ ├── build │ │ └── Vortice.DirectML.props │ └── runtimes │ │ ├── LICENSE.txt │ │ ├── linux-x64 │ │ └── libdirectml.so │ │ ├── win-arm │ │ └── native │ │ │ ├── DirectML.Debug.dll │ │ │ └── DirectML.dll │ │ ├── win-arm64 │ │ └── native │ │ │ ├── DirectML.Debug.dll │ │ │ └── DirectML.dll │ │ ├── win-x64 │ │ └── native │ │ │ ├── DirectML.Debug.dll │ │ │ └── DirectML.dll │ │ └── win-x86 │ │ └── native │ │ ├── DirectML.Debug.dll │ │ └── DirectML.dll ├── Vortice.DirectSound │ ├── Buffer3DSettings.cs │ ├── Capabilities.cs │ ├── CaptureBufferCapabilities.cs │ ├── CaptureBufferDescription.cs │ ├── CaptureEffectDescription.cs │ ├── DSound.cs │ ├── DeviceInformation.cs │ ├── EnumDelegateCallback.cs │ ├── IDirectSound.cs │ ├── IDirectSound3DBuffer.cs │ ├── IDirectSound3DListener.cs │ ├── IDirectSound8.cs │ ├── IDirectSoundBuffer.cs │ ├── IDirectSoundCapture.cs │ ├── IDirectSoundCaptureFXNoiseSuppress.cs │ ├── IDirectSoundFXChorus.cs │ ├── IDirectSoundFXCompressor.cs │ ├── IDirectSoundFXDistortion.cs │ ├── IDirectSoundFXEcho.cs │ ├── IDirectSoundFXFlanger.cs │ ├── IDirectSoundFXGargle.cs │ ├── IDirectSoundFXI3DL2Reverb.cs │ ├── IDirectSoundFXParamEq.cs │ ├── IDirectSoundFXWavesReverb.cs │ ├── Listener3DSettings.cs │ ├── Mappings.xml │ ├── NotificationPosition.cs │ ├── SoundBufferDescription.cs │ └── Vortice.DirectSound.csproj ├── Vortice.DirectStorage │ ├── DirectStorage.cs │ ├── ErrorFirstFailure.cs │ ├── IDStorageFactory.cs │ ├── IDStorageQueue.cs │ ├── LICENSE.txt │ ├── Mappings.xml │ ├── Request.cs │ ├── RequestOptions.cs │ ├── Vortice.DirectStorage.csproj │ ├── build │ │ └── net461 │ │ │ └── Vortice.DirectStorage.props │ └── runtimes │ │ ├── win-arm │ │ └── native │ │ │ ├── dstorage.dll │ │ │ └── dstoragecore.dll │ │ ├── win-arm64 │ │ └── native │ │ │ ├── dstorage.dll │ │ │ └── dstoragecore.dll │ │ ├── win-x64 │ │ └── native │ │ │ ├── dstorage.dll │ │ │ └── dstoragecore.dll │ │ └── win-x86 │ │ └── native │ │ ├── dstorage.dll │ │ └── dstoragecore.dll ├── Vortice.DirectX │ ├── DCommon │ │ └── PixelFormat.cs │ ├── DXCore │ │ ├── DXCore.cs │ │ ├── IDXCoreAdapter.cs │ │ ├── IDXCoreAdapterFactory.cs │ │ └── IDXCoreAdapterList.cs │ ├── DXGI │ │ ├── FormatHelper.cs │ │ ├── GammaControl.cs │ │ ├── GammaControlCapabilities.cs │ │ ├── JpegAcHuffmanTable.cs │ │ ├── JpegDcHuffmanTable.cs │ │ ├── JpegQuantizationTable.cs │ │ ├── ModeDescription.cs │ │ ├── Rational.cs │ │ └── SampleDescription.cs │ ├── DataBox.cs │ ├── DataRectangle.cs │ ├── DataStream.cs │ ├── Direct3D │ │ ├── Blob.cs │ │ ├── Include.cs │ │ ├── IncludeShadow.cs │ │ ├── IncludeVtbl.cs │ │ └── ShaderMacro.cs │ ├── FourCC.cs │ ├── LARGE_INTEGER.cs │ ├── Luid.cs │ ├── Mappings.xml │ ├── Multimedia │ │ ├── AudioEndpointRole.cs │ │ ├── RiffChunk.cs │ │ ├── RiffParser.cs │ │ ├── SoundStream.cs │ │ ├── WaveFormat.cs │ │ ├── WaveFormatAdpcm.cs │ │ ├── WaveFormatEncoding.cs │ │ └── WaveFormatExtensible.cs │ ├── RawRect.cs │ ├── RawRectF.cs │ ├── UInt24.cs │ ├── UnsafeUtilities.cs │ ├── Vortice.DirectX.csproj │ └── Win32 │ │ ├── BitmapInfoHeader.cs │ │ ├── ByHandleFileInformation.cs │ │ ├── NativeMessage.cs │ │ ├── PointerButtonChangeType.cs │ │ ├── PointerFlags.cs │ │ ├── PointerInfo.cs │ │ ├── PointerInputType.cs │ │ └── PropertyKeys.cs ├── Vortice.Dxc │ ├── Dxc.cs │ ├── DxcCompiler.cs │ ├── DxcCompilerOptions.cs │ ├── DxcShaderModel.cs │ ├── DxcShaderStage.cs │ ├── DxcValidatorFlags.cs │ ├── DxcVersionInfoFlags.cs │ ├── Dxil.cs │ ├── IDxcAssembler.cs │ ├── IDxcBlob.cs │ ├── IDxcCompiler.cs │ ├── IDxcCompiler2.cs │ ├── IDxcCompiler3.cs │ ├── IDxcCompilerArgs.cs │ ├── IDxcContainerBuilder.cs │ ├── IDxcContainerReflection.cs │ ├── IDxcExtraOutputs.cs │ ├── IDxcLibrary.cs │ ├── IDxcLinker.cs │ ├── IDxcOperationResult.cs │ ├── IDxcPdbUtils.cs │ ├── IDxcResult.cs │ ├── IDxcUtils.cs │ ├── IDxcValidator.cs │ ├── IDxcVersionInfo2.cs │ ├── IDxcVersionInfo3.cs │ ├── Mappings.xml │ ├── Utf16PinnedStringArray.cs │ ├── Utf8PinnedStringArray.cs │ └── Vortice.Dxc.csproj ├── Vortice.MediaFoundation │ ├── CaptureEngineAttributeKeys.cs │ ├── DeviceStates.cs │ ├── IMFActivate.cs │ ├── IMFActivateCollection.cs │ ├── IMFAsyncResult.cs │ ├── IMFAttributes.cs │ ├── IMFCaptureEngine.cs │ ├── IMFDXGIDeviceManager.cs │ ├── IMFGetService.cs │ ├── IMFMediaEngine.cs │ ├── IMFMediaEngineClassFactory.cs │ ├── IMFMediaEngineClassFactory2.cs │ ├── IMFMediaEngineClassFactoryEx.cs │ ├── IMFSourceReader.cs │ ├── IMFSourceReaderCallbackBase.cs │ ├── IMFSourceResolver.cs │ ├── IMFVirtualCamera.cs │ ├── MFByteStream.cs │ ├── Mappings.xml │ ├── MediaAttributeKey.cs │ ├── MediaAttributeKeys.cs │ ├── MediaEngineAttributeKeys.cs │ ├── MediaFactory.cs │ ├── StorageAccessMode.cs │ ├── VideoFormatGuids.cs │ ├── Vortice.MediaFoundation.csproj │ ├── WASAPI │ │ ├── IMMDevice.cs │ │ └── IMMDeviceEnumerator.cs │ └── WorkQueueId.cs ├── Vortice.UIAnimation │ ├── IUIAnimationManager.cs │ ├── IUIAnimationManager2.cs │ ├── IUIAnimationTimer.cs │ ├── IUIAnimationTransition2.cs │ ├── IUIAnimationTransitionFactory.cs │ ├── IUIAnimationTransitionFactory2.cs │ ├── IUIAnimationTransitionLibrary.cs │ ├── IUIAnimationTransitionLibrary2.cs │ ├── IUIAnimationVariable2.cs │ ├── IUIAnimationVariableChangeHandler2.cs │ ├── IUIAnimationVariableChangeHandler2Vtbl.cs │ ├── IUIAnimationVariableIntegerChangeHandler2.cs │ ├── IUIAnimationVariableIntegerChangeHandler2Vtbl.cs │ ├── Mappings.xml │ └── Vortice.UIAnimation.csproj ├── Vortice.WinForms │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RenderControl.cs │ ├── RenderForm.cs │ ├── RenderLoop.cs │ ├── Vortice.WinForms.csproj │ └── Win32Native.cs ├── Vortice.WinUI │ ├── Composition │ │ ├── ICompositionDrawingSurfaceInterop.cs │ │ ├── ICompositionDrawingSurfaceInterop2.cs │ │ ├── ICompositionGraphicsDeviceInterop.cs │ │ ├── ICompositorInterop.cs │ │ └── IVisualInteractionSourceInterop.cs │ ├── ISurfaceImageSourceManagerNative.cs │ ├── ISurfaceImageSourceNative.cs │ ├── ISurfaceImageSourceNativeWithD2D.cs │ ├── ISwapChainBackgroundPanelNative.cs │ ├── ISwapChainPanelNative.cs │ ├── ISwapChainPanelNative2.cs │ ├── IVirtualSurfaceImageSourceNative.cs │ ├── IVirtualSurfaceUpdatesCallbackNative.cs │ ├── Input │ │ └── IInputCursorStaticsInterop.cs │ ├── Mappings.xml │ ├── Vortice.WinUI.csproj │ └── WinUIHelpers.cs ├── Vortice.Wpf │ ├── D3D11ImageSource.cs │ ├── D3D9DeviceService.cs │ ├── D3D9Extensions.cs │ ├── DrawEventArgs.cs │ ├── DrawingSurface.cs │ ├── DrawingSurfaceEventArgs.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Vortice.Wpf.csproj ├── Vortice.XAudio2 │ ├── AudioBuffer.cs │ ├── DistanceCurve.cs │ ├── Documentation.xml │ ├── DspSettings.cs │ ├── EffectDescriptor.cs │ ├── Emitter.cs │ ├── ErrorEventArgs.cs │ ├── Fx │ │ ├── Fx.cs │ │ ├── ReverbI3DL2Parameters.cs │ │ └── VolumeMeterLevels.cs │ ├── IXAudio2.cs │ ├── IXAudio2SourceVoice.cs │ ├── IXAudio2Voice.cs │ ├── Listener.cs │ ├── Mappings.xml │ ├── SubmixVoiceFlags.cs │ ├── Vortice.XAudio2.csproj │ ├── X3DAudio.cs │ ├── X3DAudioHandle.cs │ ├── XAPO │ │ ├── LockParameters.cs │ │ └── XAPO.cs │ ├── XAudio2.cs │ └── XAudio2Native.cs ├── Vortice.XInput │ ├── BatteryDeviceType.cs │ ├── BatteryInformation.cs │ ├── BatteryLevel.cs │ ├── BatteryType.cs │ ├── Capabilities.cs │ ├── CapabilityFlags.cs │ ├── DeviceQueryType.cs │ ├── DeviceSubType.cs │ ├── DeviceType.cs │ ├── Gamepad.cs │ ├── GamepadButtons.cs │ ├── GamepadVirtualKey.cs │ ├── KeyStrokeFlags.cs │ ├── Keystroke.cs │ ├── State.cs │ ├── Vibration.cs │ ├── Vortice.XInput.csproj │ ├── XInput.cs │ └── XInputVersion.cs └── native │ └── include │ ├── DirectStorage │ ├── dstorage.h │ └── dstorageerr.h │ ├── WinUI │ ├── Microsoft.UI.Composition.Interop.h │ ├── Microsoft.UI.Input.InputCursor.Interop.h │ ├── Microsoft.UI.Interop.h │ ├── dwrite.h │ ├── dwrite_1.h │ ├── dwrite_2.h │ ├── dwrite_3.h │ ├── dwrite_core.h │ ├── microsoft.ui.xaml.hosting.desktopwindowxamlsource.h │ ├── microsoft.ui.xaml.hosting.referencetracker.h │ ├── microsoft.ui.xaml.media.dxinterop.h │ ├── microsoft.ui.xaml.window.h │ ├── winrt │ │ ├── Microsoft.UI.Composition.Interop.h │ │ ├── Microsoft.UI.Input.InputCursor.Interop.h │ │ └── Microsoft.UI.Interop.h │ ├── winrtdirect3d11.h │ ├── winrtdirectxcommon.h │ └── xamlom.winui.h │ ├── directx │ ├── DirectML.h │ ├── d3d12.h │ ├── d3d12compatibility.h │ ├── d3d12sdklayers.h │ ├── d3d12shader.h │ ├── d3d12video.h │ ├── d3dcommon.h │ ├── dxcore.h │ ├── dxcore_interface.h │ ├── dxgicommon.h │ └── dxgiformat.h │ ├── dxc │ ├── dxcapi.h │ ├── dxcerrors.h │ └── dxcisense.h │ ├── xapo.h │ ├── xapofx.h │ ├── xaudio2.h │ └── xaudio2fx.h └── tests ├── Directory.Build.props ├── Directory.Build.targets ├── Vortice.D3DCompiler.Test ├── Assets │ ├── Common.hlsli │ ├── Triangle.hlsl │ ├── TriangleError.hlsl │ └── TriangleSingleFile.hlsl ├── CompileTests.cs ├── ShaderIncludeHandler.cs └── Vortice.D3DCompiler.Test.csproj ├── Vortice.DXGI.Tests ├── FormatTests.cs └── Vortice.DXGI.Tests.csproj └── Vortice.Dxc.Test ├── Assets ├── Common.hlsli ├── Triangle.hlsl ├── TriangleError.hlsl └── TriangleSingleFile.hlsl ├── CompileTests.cs ├── IDxcUtilsTests.cs ├── ShaderCodeHelper.cs ├── ShaderIncludeHandler.cs └── Vortice.Dxc.Test.csproj /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [amerkoleci] 2 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'main' 7 | paths-ignore: 8 | - 'docs/**' 9 | - '*.md' 10 | pull_request: 11 | paths-ignore: 12 | - 'docs/**' 13 | - '*.md' 14 | 15 | jobs: 16 | build: 17 | runs-on: windows-latest 18 | 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | 23 | - name: Setup .NET SDK 24 | uses: actions/setup-dotnet@v4 25 | with: 26 | global-json-file: ./global.json 27 | 28 | - name: Pack 29 | run: dotnet pack Vortice.Windows.sln --configuration Release -p:Packing=true 30 | 31 | - name: Publish to NuGet 32 | if: github.event_name == 'push' 33 | run: dotnet nuget push artifacts/**/*.nupkg -s "https://api.nuget.org/v3/index.json" -k ${{secrets.NUGET_TOKEN}} --skip-duplicate 34 | -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | true 11 | true 12 | true 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Vortice.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/Vortice.snk -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.200", 4 | "rollForward": "latestFeature", 5 | "allowPrerelease": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/AdvancedTextRenderingApp/AdvancedTextRenderingApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | AdvancedTextRenderingApp 8 | false 9 | false 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | false 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11.Wpf/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11.Wpf/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | using System.Data; 3 | using System.Windows; 4 | 5 | namespace HelloDirect3D11.Wpf; 6 | 7 | /// 8 | /// Interaction logic for App.xaml 9 | /// 10 | public partial class App : Application 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11.Wpf/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 4 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11.Wpf/Assets/Triangle.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput { 2 | float4 Position : POSITION; 3 | float4 Color : COLOR; 4 | }; 5 | 6 | struct PSInput { 7 | float4 Position : SV_POSITION; 8 | float4 Color : COLOR; 9 | }; 10 | 11 | PSInput VSMain(VSInput input) { 12 | PSInput result; 13 | result.Position = input.Position; 14 | result.Color = input.Color; 15 | return result; 16 | } 17 | 18 | float4 PSMain(PSInput input) : SV_TARGET{ 19 | return input.Color; 20 | } 21 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11.Wpf/HelloDirect3D11.Wpf.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11/Assets/Triangle.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput { 2 | float4 Position : POSITION; 3 | float4 Color : COLOR; 4 | }; 5 | 6 | struct PSInput { 7 | float4 Position : SV_POSITION; 8 | float4 Color : COLOR; 9 | }; 10 | 11 | PSInput VSMain(VSInput input) { 12 | PSInput result; 13 | result.Position = input.Position; 14 | result.Color = input.Color; 15 | return result; 16 | } 17 | 18 | float4 PSMain(PSInput input) : SV_TARGET{ 19 | return input.Color; 20 | } 21 | -------------------------------------------------------------------------------- /samples/HelloDirect3D11/HelloDirect3D11.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | true 8 | link 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12/Assets/Common.hlsli: -------------------------------------------------------------------------------- 1 | struct VSInput { 2 | float4 Position : POSITION; 3 | float4 Color : COLOR; 4 | }; 5 | 6 | struct PSInput { 7 | float4 Position : SV_POSITION; 8 | float4 Color : COLOR; 9 | }; 10 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12/Assets/Triangle.hlsl: -------------------------------------------------------------------------------- 1 | #include "Common.hlsli" 2 | 3 | PSInput VSMain(VSInput input) { 4 | PSInput result; 5 | result.Position = input.Position; 6 | result.Color = input.Color; 7 | return result; 8 | } 9 | 10 | float4 PSMain(PSInput input) : SV_TARGET{ 11 | return input.Color; 12 | } 13 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12/HelloDirect3D12.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12Raytracing/HelloDirect3D12Raytracing.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12Raytracing/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice; 5 | using SharpGen.Runtime.Diagnostics; 6 | using SharpGen.Runtime; 7 | 8 | namespace HelloDirect3D12Raytracing; 9 | 10 | public static class Program 11 | { 12 | private class TestApplication : Application 13 | { 14 | protected override void InitializeBeforeRun() 15 | { 16 | var validation = false; 17 | #if DEBUG 18 | validation = true; 19 | #endif 20 | 21 | _graphicsDevice = new D3D12GraphicsDevice(validation, MainWindow!); 22 | } 23 | } 24 | 25 | public static void Main() 26 | { 27 | #if DEBUG 28 | Configuration.EnableObjectTracking = true; 29 | #endif 30 | 31 | using TestApplication app = new(); 32 | app.Run(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12Raytracing/Shaders/Common.hlsl: -------------------------------------------------------------------------------- 1 | // Hit information, aka ray payload 2 | // This sample only carries a shading color and hit distance. 3 | // Note that the payload should be kept as small as possible, 4 | // and that its size must be declared in the corresponding 5 | // D3D12_RAYTRACING_SHADER_CONFIG pipeline subobjet. 6 | struct HitInfo 7 | { 8 | float4 colorAndDistance; 9 | }; 10 | 11 | // Attributes output by the raytracing when hitting a surface, 12 | // here the barycentric coordinates 13 | struct Attributes 14 | { 15 | float2 bary; 16 | }; 17 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12Raytracing/Shaders/Hit.hlsl: -------------------------------------------------------------------------------- 1 | #include "Common.hlsl" 2 | 3 | struct STriVertex 4 | { 5 | float3 vertex; 6 | float4 color; 7 | }; 8 | 9 | StructuredBuffer BTriVertex : register(t0); 10 | 11 | [shader("closesthit")] 12 | void ClosestHit(inout HitInfo payload, Attributes attrib) 13 | { 14 | float3 barycentrics = float3(1.f - attrib.bary.x - attrib.bary.y, attrib.bary.x, attrib.bary.y); 15 | 16 | uint vertId = 3 * PrimitiveIndex(); 17 | 18 | float3 hitColor = BTriVertex[vertId + 0].color * barycentrics.x + 19 | BTriVertex[vertId + 1].color * barycentrics.y + 20 | BTriVertex[vertId + 2].color * barycentrics.z; 21 | 22 | payload.colorAndDistance = float4(hitColor, RayTCurrent()); 23 | } 24 | -------------------------------------------------------------------------------- /samples/HelloDirect3D12Raytracing/Shaders/Miss.hlsl: -------------------------------------------------------------------------------- 1 | #include "Common.hlsl" 2 | 3 | [shader("miss")] 4 | void Miss(inout HitInfo payload : SV_RayPayload) 5 | { 6 | uint2 launchIndex = DispatchRaysIndex().xy; 7 | float2 dims = float2(DispatchRaysDimensions().xy); 8 | 9 | float ramp = launchIndex.y / dims.y; 10 | payload.colorAndDistance = float4(0.0f, 0.2f, 0.7f - 0.3f * ramp, -1.0f); 11 | } -------------------------------------------------------------------------------- /samples/HelloDirectInput/HelloDirectInput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | HelloDirectInput 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/HelloDirectInput/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace HelloDirectInput; 5 | 6 | public static class Program 7 | { 8 | public static void Main() 9 | { 10 | DIInputDevice directInputDevice = new DIInputDevice(); 11 | directInputDevice.Initialize(IntPtr.Zero); 12 | 13 | while (true) 14 | { 15 | if (Console.KeyAvailable) 16 | { 17 | switch (Console.ReadKey(true).KeyChar) 18 | { 19 | case 'q': 20 | return; 21 | } 22 | } 23 | 24 | directInputDevice.GetKeyboardUpdates(); 25 | directInputDevice.GetKJoystickUpdates(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/HelloDirectML/HelloDirectML.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/HelloDirectML/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using SharpGen.Runtime; 5 | 6 | namespace HelloDirectML; 7 | 8 | public static class Program 9 | { 10 | public static void Main() 11 | { 12 | #if DEBUG 13 | Configuration.EnableObjectTracking = true; 14 | #endif 15 | 16 | using HelloDml app = new(); 17 | app.Run(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/HelloDirectStorage/HelloDirectStorage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | HelloDirectStorage 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/HelloDirectStorage/Test.txt: -------------------------------------------------------------------------------- 1 | Hello there! -------------------------------------------------------------------------------- /samples/HelloXAudio2/Assets/AssetInfo.txt: -------------------------------------------------------------------------------- 1 | SpaceVehicleFlyby.wav 2 | 3 | Source: GDC 2016 Game Audio Bundle 4 | Licence : Royalty free. Without attribution. 5 | Contact: timothy@sonniss.com 6 | 7 | file type audio / wav 8 | Encoding Microsoft PCM 9 | Codec name pcm_s24le 10 | Codec long name PCM signed 24-bit little-endian 11 | Channels 2 12 | SampleRate 96000 13 | Bits / Sample 24 14 | Duration 3.976052 15 | Bitrate 4608000 16 | -------------------------------------------------------------------------------- /samples/HelloXAudio2/Assets/SpaceVehicleFlyby.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/samples/HelloXAudio2/Assets/SpaceVehicleFlyby.wav -------------------------------------------------------------------------------- /samples/HelloXAudio2/HelloXAudio2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | HelloXAudio2 7 | enable 8 | false 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/MediaFoundation/AudioPlay/AudioPlay.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | AudioPlay 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/MediaFoundation/AudioPlay/ergon.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/samples/MediaFoundation/AudioPlay/ergon.wav -------------------------------------------------------------------------------- /samples/MediaFoundation/EnumerateDevices/EnumerateDevices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | EnumerateDevices 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/IGraphicsDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace Vortice; 7 | 8 | public interface IGraphicsDevice : IDisposable 9 | { 10 | bool DrawFrame(Action draw, [CallerMemberName] string? frameName = null); 11 | } 12 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/NativeMethods.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/CsWin32.schema.json", 3 | "allowMarshaling": false 4 | } 5 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/NativeMethods.txt: -------------------------------------------------------------------------------- 1 | GetModuleHandle 2 | PeekMessage 3 | TranslateMessage 4 | DispatchMessage 5 | GetMessage 6 | RegisterClassExW 7 | DefWindowProc 8 | LoadCursor 9 | PostQuitMessage 10 | CreateWindowExW 11 | DestroyWindow 12 | ShowWindow 13 | GetSystemMetrics 14 | AdjustWindowRectEx 15 | GetClientRect 16 | GetWindowRect 17 | IDC_ARROW 18 | WM_KEYDOWN 19 | WM_KEYUP 20 | WM_SYSKEYDOWN 21 | WM_SYSKEYUP 22 | WM_DESTROY 23 | WM_QUIT 24 | WM_PAINT 25 | WM_ACTIVATEAPP 26 | VIRTUAL_KEY 27 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/Platforms/UWP/Application.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Distributed under the MIT license. See the LICENSE file in the project root for more information. 3 | 4 | using System; 5 | using Windows.ApplicationModel.Core; 6 | 7 | namespace Vortice 8 | { 9 | public abstract partial class Application : IDisposable 10 | { 11 | private void PlatformConstruct() 12 | { 13 | MainWindow = new Window("Vortice", 800, 600); 14 | } 15 | 16 | private void PlatformRun() 17 | { 18 | CoreApplication.Run(MainWindow); 19 | } 20 | 21 | private void PlatformExit() 22 | { 23 | CoreApplication.Exit(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/VertexPositionColor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | using Vortice.Mathematics; 6 | 7 | namespace Vortice; 8 | 9 | public readonly struct VertexPositionColor 10 | { 11 | public static unsafe readonly uint SizeInBytes = (uint)sizeof(VertexPositionColor); 12 | 13 | public VertexPositionColor(in Vector3 position, in Color4 color) 14 | { 15 | Position = position; 16 | Color = color; 17 | } 18 | 19 | public readonly Vector3 Position; 20 | public readonly Color4 Color; 21 | } 22 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/Vortice.SampleFramework.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0-windows;net9.0-windows 5 | Vortice 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/Vortice.SampleFramework/Window.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Mathematics; 5 | 6 | namespace Vortice; 7 | 8 | public sealed partial class Window 9 | { 10 | public string Title { get; private set; } 11 | public SizeI ClientSize { get; private set; } 12 | 13 | public Window(string title, int width = 1280, int height = 720) 14 | { 15 | Title = title; 16 | ClientSize = new(width, height); 17 | PlatformConstruct(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/XInput/HelloXInput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net9.0-windows 6 | HelloXInput 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Vortice.D3DCompiler/Vortice.D3DCompiler.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | D3DCompiler bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIAdapter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIAdapter 7 | { 8 | public bool CheckInterfaceSupport() where T : ComObject 9 | { 10 | return CheckInterfaceSupport(typeof(T), out _); 11 | } 12 | 13 | public bool CheckInterfaceSupport(out long userModeVersion) where T : ComObject 14 | { 15 | return CheckInterfaceSupport(typeof(T), out userModeVersion); 16 | } 17 | 18 | public bool CheckInterfaceSupport(Type type, out long userModeDriverVersion) 19 | { 20 | return CheckInterfaceSupport(type.GUID, out userModeDriverVersion).Success; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIDecodeSwapChain.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Mathematics; 5 | 6 | namespace Vortice.DXGI; 7 | 8 | public partial class IDXGIDecodeSwapChain 9 | { 10 | public SizeI DestSize 11 | { 12 | get 13 | { 14 | GetDestSize(out uint width, out uint height); 15 | return new((int)width, (int)height); 16 | } 17 | set 18 | { 19 | SetDestSize((uint)value.Width, (uint)value.Height); 20 | } 21 | } 22 | 23 | public Result PresentBuffer(uint bufferToPresent, uint syncInterval) 24 | { 25 | return PresentBuffer(bufferToPresent, syncInterval, PresentFlags.None); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIDevice1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIDevice1 7 | { 8 | public uint MaximumFrameLatency 9 | { 10 | get 11 | { 12 | GetMaximumFrameLatency(out uint latency).CheckError(); 13 | return latency; 14 | } 15 | set 16 | { 17 | SetMaximumFrameLatency(value).CheckError(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIDeviceSubObject.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIDeviceSubObject 7 | { 8 | public T GetDevice<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>() where T : IDXGIDevice 9 | { 10 | GetDevice(typeof(T).GUID, out IntPtr nativePtr).CheckError(); 11 | return MarshallingHelpers.FromPointer(nativePtr)!; 12 | } 13 | 14 | public Result GetDevice<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(out T? device) where T : IDXGIDevice 15 | { 16 | Result result = GetDevice(typeof(T).GUID, out IntPtr nativePtr); 17 | if (result.Failure) 18 | { 19 | device = default; 20 | return result; 21 | } 22 | 23 | device = MarshallingHelpers.FromPointer(nativePtr); 24 | return result; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIFactory2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIFactory2 7 | { 8 | public int RegisterOcclusionStatusEvent(WaitHandle waitHandle) 9 | { 10 | return RegisterOcclusionStatusEvent(waitHandle.SafeWaitHandle.DangerousGetHandle()); 11 | } 12 | 13 | public int RegisterStereoStatusEvent(WaitHandle waitHandle) 14 | { 15 | return RegisterStereoStatusEvent(waitHandle.SafeWaitHandle.DangerousGetHandle()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIFactory5.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public unsafe partial class IDXGIFactory5 7 | { 8 | /// 9 | /// Gets if tearing is allowed during present. 10 | /// 11 | public RawBool PresentAllowTearing 12 | { 13 | get 14 | { 15 | RawBool allowTearing; 16 | CheckFeatureSupport(Feature.PresentAllowTearing, &allowTearing, (uint)sizeof(RawBool)); 17 | return allowTearing; 18 | } 19 | } 20 | 21 | public bool CheckFeatureSupport(Feature feature, T featureSupport) where T : unmanaged 22 | { 23 | return CheckFeatureSupport(feature, &featureSupport, (uint)sizeof(T)).Success; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIFactory7.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIFactory7 7 | { 8 | public int RegisterAdaptersChangedEvent(WaitHandle waitHandle) 9 | { 10 | return RegisterAdaptersChangedEvent(waitHandle.SafeWaitHandle.DangerousGetHandle()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIOutput.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIOutput 7 | { 8 | public ModeDescription[] GetDisplayModeList(Format format, DisplayModeEnumerationFlags flags) 9 | { 10 | uint count = 0; 11 | GetDisplayModeList(format, (uint)flags, ref count, null); 12 | var result = new ModeDescription[count]; 13 | if (count > 0) 14 | { 15 | GetDisplayModeList(format, (uint)flags, ref count, result); 16 | } 17 | return result; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIOutput1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIOutput1 7 | { 8 | public ModeDescription1[] GetDisplayModeList1(Format format, DisplayModeEnumerationFlags flags) 9 | { 10 | uint count = 0; 11 | GetDisplayModeList1(format, (uint)flags, ref count, null); 12 | var result = new ModeDescription1[count]; 13 | if (count > 0) 14 | { 15 | GetDisplayModeList1(format, (uint)flags, ref count, result); 16 | } 17 | 18 | return result; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIOutput3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIOutput3 7 | { 8 | /// 9 | /// Checks for overlay support. 10 | /// 11 | /// A value for the color format. 12 | /// Instance of Direct3D device interface. 13 | /// Overlay support flags. 14 | public OverlaySupportFlags CheckOverlaySupport(Format format, IUnknown concernedDevice) 15 | { 16 | return CheckOverlaySupport_(format, concernedDevice); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIOutput4.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIOutput4 7 | { 8 | /// 9 | /// Checks for overlay color space support. 10 | /// 11 | /// A value for the color format. 12 | /// A value that specifies color space type to check overlay support for. 13 | /// Instance of Direct3D device interface. 14 | /// Overlay color space support flags. 15 | public OverlayColorSpaceSupportFlags CheckOverlayColorSpaceSupport(Format format, ColorSpaceType colorSpace, IUnknown concernedDevice) 16 | { 17 | return CheckOverlayColorSpaceSupport_(format, colorSpace, concernedDevice); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGIOutputDuplication.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGIOutputDuplication 7 | { 8 | public DataRectangle MapDesktopSurface() 9 | { 10 | MapDesktopSurface(out MappedRect mappedRect).CheckError(); 11 | return new DataRectangle(mappedRect.Bits, (uint)mappedRect.Pitch); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGISwapChain2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Mathematics; 5 | 6 | namespace Vortice.DXGI; 7 | 8 | public partial class IDXGISwapChain2 9 | { 10 | public SizeI SourceSize 11 | { 12 | get 13 | { 14 | GetSourceSize(out uint width, out uint height); 15 | return new((int)width, (int)height); 16 | } 17 | set => SetSourceSize((uint)value.Width, (uint)value.Height); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IDXGISwapChain3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IDXGISwapChain3 7 | { 8 | public SwapChainColorSpaceSupportFlags CheckColorSpaceSupport(ColorSpaceType colorSpace) 9 | { 10 | Result result = CheckColorSpaceSupport(colorSpace, out SwapChainColorSpaceSupportFlags colorSpaceSupport); 11 | if (result.Failure) 12 | { 13 | return SwapChainColorSpaceSupportFlags.None; 14 | } 15 | 16 | return colorSpaceSupport; 17 | } 18 | 19 | public Result ResizeBuffers1(uint bufferCount, uint width, uint height, Format format = Format.Unknown, SwapChainFlags swapChainFlags = SwapChainFlags.None) 20 | { 21 | return ResizeBuffers1(bufferCount, width, height, format, swapChainFlags, null, null); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IVirtualSurfaceImageSourceNative.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial class IVirtualSurfaceImageSourceNative 7 | { 8 | /// 9 | /// Gets the set of regions that must be updated on the shared surface. 10 | /// 11 | public RawRect[] UpdateRectangles 12 | { 13 | get 14 | { 15 | if (GetUpdateRectCount(out int count).Failure) 16 | { 17 | return Array.Empty(); 18 | } 19 | 20 | RawRect[] regionToUpdate = new RawRect[count]; 21 | GetUpdateRects(regionToUpdate, count); 22 | return regionToUpdate; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/IVirtualSurfaceUpdatesCallbackNative.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public abstract class IVirtualSurfaceUpdatesCallbackNativeBase : CallbackBase, IVirtualSurfaceUpdatesCallbackNative 7 | { 8 | public abstract Result UpdatesNeeded(); 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.DXGI/Vortice.DXGI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0;net8.0-windows10.0.22621 7 | DXGI bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/BezierSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial struct BezierSegment 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// The first control point for the Bezier segment. 12 | /// The second control point for the Bezier segment. 13 | /// The end point for the Bezier segment. 14 | public BezierSegment(in Vector2 point1, in Vector2 point2, in Vector2 point3) 15 | { 16 | Point1 = point1; 17 | Point2 = point2; 18 | Point3 = point3; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/CustomEffectBase.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public abstract class CustomEffectBase : CallbackBase, ID2D1EffectImpl 7 | { 8 | /// 9 | public virtual void Initialize(ID2D1EffectContext effectContext, ID2D1TransformGraph transformGraph) 10 | { 11 | } 12 | 13 | /// 14 | public virtual void PrepareForRender(ChangeType changeType) 15 | { 16 | } 17 | 18 | /// 19 | public virtual void SetGraph(ID2D1TransformGraph transformGraph) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/CustomEffectPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | [AttributeUsage(AttributeTargets.Property, Inherited = true)] 7 | public class CustomEffectPropertyAttribute : Attribute 8 | { 9 | public CustomEffectPropertyAttribute(PropertyType propertyType, int order) 10 | { 11 | PropertyType = propertyType; 12 | Order = order; 13 | } 14 | 15 | public PropertyType PropertyType { get; } 16 | public int Order { get; } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/DirectWrite/IDWriteColorGlyphRunEnumerator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectWrite; 5 | 6 | public partial class IDWriteColorGlyphRunEnumerator 7 | { 8 | public ColorGlyphRun CurrentRun => GetCurrentRun(); 9 | 10 | internal unsafe ColorGlyphRun GetCurrentRun() 11 | { 12 | ColorGlyphRun colorGlyphRun = new(); 13 | ColorGlyphRun.__Native* colorGlyphRun_ = (ColorGlyphRun.__Native*)GetCurrentRun_(); 14 | colorGlyphRun.__MarshalFrom(ref *colorGlyphRun_); 15 | return colorGlyphRun; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/DirectWrite/IDWriteColorGlyphRunEnumerator1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectWrite; 5 | 6 | public partial class IDWriteColorGlyphRunEnumerator1 7 | { 8 | public new ColorGlyphRun1 CurrentRun => GetCurrentRun(); 9 | 10 | internal new unsafe ColorGlyphRun1 GetCurrentRun() 11 | { 12 | ColorGlyphRun1 colorGlyphRun = new(); 13 | ColorGlyphRun1.__Native* colorGlyphRun_ = (ColorGlyphRun1.__Native*)GetCurrentRun_(); 14 | colorGlyphRun.__MarshalFrom(ref *colorGlyphRun_); 15 | return colorGlyphRun; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/DirectWrite/IDWriteFontFile.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectWrite; 5 | 6 | public partial class IDWriteFontFile 7 | { 8 | /// 9 | /// Obtains the reference to the reference key of a font file. The returned reference is valid until the font file object is released. 10 | /// 11 | /// the reference to the reference key of a font file. 12 | public unsafe Span GetReferenceKey() 13 | { 14 | void* keyPtr; 15 | GetReferenceKey(&keyPtr, out uint keySize); 16 | return new Span(keyPtr, (int)keySize); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/DirectWrite/IDWriteLocalizedStrings.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectWrite; 5 | 6 | public unsafe partial class IDWriteLocalizedStrings 7 | { 8 | public string GetString(uint index) 9 | { 10 | uint length = GetStringLength(index); 11 | char* chars = stackalloc char[(int)length + 1]; 12 | GetString(index, new IntPtr(chars), length + 1); 13 | return new string(chars, 0, (int)length); 14 | } 15 | 16 | public string GetLocaleName(uint index) 17 | { 18 | uint length = GetLocaleNameLength(index); 19 | char* chars = stackalloc char[(int)length + 1]; 20 | GetLocaleName(index, new IntPtr(chars), length + 1); 21 | return new string(chars, 0, (int)length); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/DirectWrite/TextRange.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectWrite; 5 | 6 | /// 7 | /// Specifies a range of text positions where format is applied in the text represented by an object. 8 | /// 9 | public partial struct TextRange 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The start position of the text range. 15 | /// The number positions in the text range. 16 | public TextRange(uint startPosition, uint length) 17 | { 18 | StartPosition = startPosition; 19 | Length = length; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/AlphaMask.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class AlphaMask : ID2D1Effect 7 | { 8 | public AlphaMask(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.AlphaMask)) 10 | { 11 | } 12 | 13 | public AlphaMask(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.AlphaMask)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Atlas.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Atlas : ID2D1Effect 7 | { 8 | public Atlas(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Atlas)) 10 | { 11 | 12 | } 13 | 14 | public Atlas(ID2D1EffectContext context) 15 | : base(context.CreateEffect(EffectGuids.Atlas)) 16 | { 17 | } 18 | 19 | public Vector4 InputRectangle 20 | { 21 | set => SetValue((int)AtlasProperties.InputRectangle, value); 22 | get => GetVector4Value((int)AtlasProperties.InputRectangle); 23 | } 24 | 25 | public Vector4 InputPaddingRect 26 | { 27 | set => SetValue((int)AtlasProperties.InputPaddingRectangle, value); 28 | get => GetVector4Value((int)AtlasProperties.InputPaddingRectangle); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Blend.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Blend : ID2D1Effect 7 | { 8 | public Blend(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Blend)) 10 | { 11 | } 12 | 13 | public Blend(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Blend)) 15 | { 16 | } 17 | 18 | public BlendMode Mode 19 | { 20 | set => SetValue((int)BlendProperties.Mode, value); 21 | get => GetEnumValue((int)BlendProperties.Mode); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Border.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Border : ID2D1Effect 7 | { 8 | public Border(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Border)) 10 | { 11 | } 12 | 13 | public Border(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Border)) 15 | { 16 | } 17 | 18 | public BorderEdgeMode EdgeModeX 19 | { 20 | set => SetValue((int)BorderProperties.EdgeModeX, value); 21 | get => GetEnumValue((int)BorderProperties.EdgeModeX); 22 | } 23 | 24 | public BorderEdgeMode EdgeModeY 25 | { 26 | set => SetValue((int)BorderProperties.EdgeModeY, value); 27 | get => GetEnumValue((int)BorderProperties.EdgeModeY); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Brightness.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Brightness : ID2D1Effect 7 | { 8 | public Brightness(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Brightness)) 10 | { 11 | } 12 | 13 | public Brightness(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Brightness)) 15 | { 16 | } 17 | 18 | public Vector2 WhitePoint 19 | { 20 | set => SetValue((int)BrightnessProperties.WhitePoint, value); 21 | get => GetVector2Value((int)BrightnessProperties.WhitePoint); 22 | } 23 | 24 | public Vector2 BlackPoint 25 | { 26 | set => SetValue((int)BrightnessProperties.BlackPoint, value); 27 | get => GetVector2Value((int)BrightnessProperties.BlackPoint); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/ColorMatrix.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public class ColorMatrix : ID2D1Effect 7 | { 8 | public ColorMatrix(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.ColorMatrix)) 10 | { 11 | } 12 | 13 | public ColorMatrix(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.ColorMatrix)) 15 | { 16 | } 17 | 18 | public Matrix5x4 Matrix 19 | { 20 | set => SetValue((int)ColorMatrixProperties.ColorMatrix, value); 21 | get => GetMatrix5x4Value((int)ColorMatrixProperties.ColorMatrix); 22 | } 23 | 24 | public ColorMatrixAlphaMode AlphaMode 25 | { 26 | set => SetValue((int)ColorMatrixProperties.AlphaMode, value); 27 | get => GetEnumValue((int)ColorMatrixProperties.AlphaMode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Composite.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Composite : ID2D1Effect 7 | { 8 | public Composite(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Composite)) 10 | { 11 | } 12 | 13 | public Composite(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Composite)) 15 | { 16 | } 17 | 18 | public CompositeMode Mode 19 | { 20 | set => SetValue((int)CompositeProperties.Mode, value); 21 | get => GetEnumValue((int)CompositeProperties.Mode); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Contrast.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Contrast : ID2D1Effect 7 | { 8 | public Contrast(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Contrast)) 10 | { 11 | } 12 | 13 | public Contrast(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Contrast)) 15 | { 16 | } 17 | 18 | public float Value 19 | { 20 | set => SetValue((int)ContrastProperties.Contrast, value); 21 | get => GetFloatValue((int)ContrastProperties.Contrast); 22 | } 23 | 24 | public bool ClampInput 25 | { 26 | set => SetValue((int)ContrastProperties.ClampInput, value); 27 | get => GetBoolValue((int)ContrastProperties.ClampInput); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Crop.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Crop : ID2D1Effect 7 | { 8 | public Crop(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Crop)) 10 | { 11 | } 12 | 13 | public Crop(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Crop)) 15 | { 16 | } 17 | 18 | public Vector4 Rectangle 19 | { 20 | set => SetValue((int)CropProperties.Rectangle, value); 21 | get => GetVector4Value((int)CropProperties.Rectangle); 22 | } 23 | 24 | public BorderMode BorderMode 25 | { 26 | set => SetValue((int)CropProperties.BorderMode, value); 27 | get => GetEnumValue((int)CropProperties.BorderMode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/CrossFade.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class CrossFade : ID2D1Effect 7 | { 8 | public CrossFade(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.CrossFade)) 10 | { 11 | } 12 | 13 | public CrossFade(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.CrossFade)) 15 | { 16 | } 17 | 18 | public float Weight 19 | { 20 | set => SetValue((int)CrossFadeProperties.Weight, value); 21 | get => GetFloatValue((int)CrossFadeProperties.Weight); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Emboss.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Emboss : ID2D1Effect 7 | { 8 | public Emboss(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Emboss)) 10 | { 11 | } 12 | 13 | public Emboss(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Emboss)) 15 | { 16 | } 17 | 18 | public float Height 19 | { 20 | get => GetFloatValue((int)EmbossProperties.Height); 21 | set => SetValue((int)EmbossProperties.Height, value); 22 | } 23 | 24 | public float Direction 25 | { 26 | get => GetFloatValue((int)EmbossProperties.Direction); 27 | set => SetValue((int)EmbossProperties.Direction, value); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Exposure.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Exposure : ID2D1Effect 7 | { 8 | public Exposure(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Exposure)) 10 | { 11 | } 12 | 13 | public Exposure(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Exposure)) 15 | { 16 | } 17 | 18 | public float Value 19 | { 20 | get => GetFloatValue((int)ExposureProperties.ExposureValue); 21 | set => SetValue((int)ExposureProperties.ExposureValue, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Flood.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Flood : ID2D1Effect 7 | { 8 | public Flood(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Flood)) 10 | { 11 | } 12 | 13 | public Flood(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Flood)) 15 | { 16 | } 17 | 18 | public Vector4 Color 19 | { 20 | get => GetVector4Value((int)FloodProperties.Color); 21 | set => SetValue((int)FloodProperties.Color, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Grayscale.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Grayscale : ID2D1Effect 7 | { 8 | public Grayscale(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Grayscale)) 10 | { 11 | } 12 | 13 | public Grayscale(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Grayscale)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/HueRotation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class HueRotation : ID2D1Effect 7 | { 8 | public HueRotation(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.HueRotation)) 10 | { 11 | } 12 | 13 | public HueRotation(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.HueRotation)) 15 | { 16 | } 17 | 18 | public float Angle 19 | { 20 | get => GetFloatValue((int)HueRotationProperties.Angle); 21 | set => SetValue((int)HueRotationProperties.Angle, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/HueToRgb.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class HueToRgb : ID2D1Effect 7 | { 8 | public HueToRgb(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.HueToRgb)) 10 | { 11 | } 12 | 13 | public HueToRgb(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.HueToRgb)) 15 | { 16 | } 17 | 18 | public HueToRGBInputColorSpace InputColorSpace 19 | { 20 | get => GetEnumValue((int)HueToRGBProperties.InputColorSpace); 21 | set => SetValue((int)HueToRGBProperties.InputColorSpace, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Invert.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Invert : ID2D1Effect 7 | { 8 | public Invert(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Invert)) 10 | { 11 | } 12 | 13 | public Invert(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Invert)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/LuminanceToAlpha.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class LuminanceToAlpha : ID2D1Effect 7 | { 8 | public LuminanceToAlpha(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.LuminanceToAlpha)) 10 | { 11 | } 12 | 13 | public LuminanceToAlpha(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.LuminanceToAlpha)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Opacity.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Opacity : ID2D1Effect 7 | { 8 | public Opacity(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Opacity)) 10 | { 11 | } 12 | 13 | public Opacity(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Opacity)) 15 | { 16 | } 17 | 18 | public float Value 19 | { 20 | get => GetFloatValue((int)OpacityProperties.Opacity); 21 | set => SetValue((int)OpacityProperties.Opacity, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/OpacityMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class OpacityMetadata : ID2D1Effect 7 | { 8 | public OpacityMetadata(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.OpacityMetadata)) 10 | { 11 | } 12 | 13 | public OpacityMetadata(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.OpacityMetadata)) 15 | { 16 | } 17 | 18 | public Vector4 InputOpaqueRectangle 19 | { 20 | get => GetVector4Value((int)OpacityMetadataProperties.InputOpaqueRectangle); 21 | set => SetValue((int)OpacityMetadataProperties.InputOpaqueRectangle, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Premultiply.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Premultiply : ID2D1Effect 7 | { 8 | public Premultiply(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Premultiply)) 10 | { 11 | } 12 | 13 | public Premultiply(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Premultiply)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/RgbToHue.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class RgbToHue : ID2D1Effect 7 | { 8 | public RgbToHue(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.RgbToHue)) 10 | { 11 | } 12 | 13 | public RgbToHue(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.RgbToHue)) 15 | { 16 | } 17 | 18 | public RGBToHueOutputColorSpace OutputColorSpace 19 | { 20 | set => SetValue((int)RGBToHueProperties.OutputColorSpace, value); 21 | get => GetEnumValue((int)RGBToHueProperties.OutputColorSpace); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Saturation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | using Props = SaturationProperties; 7 | public sealed class Saturation : ID2D1Effect 8 | { 9 | public Saturation(ID2D1DeviceContext context) 10 | : base(context.CreateEffect(EffectGuids.Saturation)) 11 | { 12 | } 13 | 14 | public Saturation(ID2D1EffectContext context) 15 | : base(context.CreateEffect(EffectGuids.Saturation)) 16 | { 17 | } 18 | 19 | public float Value 20 | { 21 | set => SetValue((int)Props.Saturation, value); 22 | get => GetFloatValue((int)Props.Saturation); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Sepia.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.DCommon; 5 | 6 | namespace Vortice.Direct2D1.Effects; 7 | 8 | public class Sepia : ID2D1Effect 9 | { 10 | public Sepia(ID2D1DeviceContext context) 11 | : base(context.CreateEffect(EffectGuids.Sepia)) 12 | { 13 | } 14 | 15 | public Sepia(ID2D1EffectContext context) 16 | : base(context.CreateEffect(EffectGuids.Sepia)) 17 | { 18 | } 19 | 20 | public float Intensity 21 | { 22 | set => SetValue((int)SepiaProperties.Intensity, value); 23 | get => GetFloatValue((int)SepiaProperties.Intensity); 24 | } 25 | 26 | public AlphaMode AlphaMode 27 | { 28 | set => SetValue((int)SepiaProperties.AlphaMode, value); 29 | get => GetEnumValue((int)SepiaProperties.AlphaMode); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Sharpen.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Sharpen : ID2D1Effect 7 | { 8 | public Sharpen(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Sharpen)) 10 | { 11 | } 12 | 13 | public Sharpen(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Sharpen)) 15 | { 16 | } 17 | 18 | public float Sharpness 19 | { 20 | set => SetValue((int)SharpenProperties.Sharpness, value); 21 | get => GetFloatValue((int)SharpenProperties.Sharpness); 22 | } 23 | 24 | public float Threshold 25 | { 26 | set => SetValue((int)SharpenProperties.Threshold, value); 27 | get => GetFloatValue((int)SharpenProperties.Threshold); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/TemperatureAndTint.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class TemperatureAndTint : ID2D1Effect 7 | { 8 | public TemperatureAndTint(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.TemperatureTint)) 10 | { 11 | } 12 | 13 | public TemperatureAndTint(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.TemperatureTint)) 15 | { 16 | } 17 | 18 | public float Temperature 19 | { 20 | get => GetFloatValue((int)TemperatureAndTintProperties.Temperature); 21 | set => SetValue((int)TemperatureAndTintProperties.Temperature, value); 22 | } 23 | 24 | public float Tint 25 | { 26 | get => GetFloatValue((int)TemperatureAndTintProperties.Tint); 27 | set => SetValue((int)TemperatureAndTintProperties.Tint, value); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Tile.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Tile : ID2D1Effect 7 | { 8 | public Tile(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Tile)) 10 | { 11 | } 12 | 13 | public Tile(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Tile)) 15 | { 16 | } 17 | 18 | public Vector4 Rectangle 19 | { 20 | get => GetVector4Value((int)TileProperties.Rectangle); 21 | set => SetValue((int)TileProperties.Rectangle, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Tint.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Tint : ID2D1Effect 7 | { 8 | public Tint(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.Tint)) 10 | { 11 | } 12 | 13 | public Tint(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.Tint)) 15 | { 16 | } 17 | 18 | public Vector4 Color 19 | { 20 | set => SetValue((int)TintProperties.Color, value); 21 | get => GetVector4Value((int)TintProperties.Color); 22 | } 23 | 24 | public bool ClampOutput 25 | { 26 | set => SetValue((int)TintProperties.ClampOutput, value); 27 | get => GetBoolValue((int)TintProperties.ClampOutput); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Effects/Unpremultiply.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1.Effects; 5 | 6 | public sealed class Unpremultiply : ID2D1Effect 7 | { 8 | public Unpremultiply(ID2D1DeviceContext context) 9 | : base(context.CreateEffect(EffectGuids.UnPremultiply)) 10 | { 11 | } 12 | 13 | public Unpremultiply(ID2D1EffectContext context) 14 | : base(context.CreateEffect(EffectGuids.UnPremultiply)) 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Ellipse.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | /// 9 | /// Contains the center point, x-radius, and y-radius of an ellipse. 10 | /// 11 | public partial struct Ellipse 12 | { 13 | /// 14 | /// Initializes a new instance of the struct. 15 | /// 16 | /// The center point of the ellipse. 17 | /// The X-radius of the ellipse. 18 | /// The Y-radius of the ellipse. 19 | public Ellipse(in Vector2 point, float radiusX, float radiusY) 20 | { 21 | Point = point; 22 | RadiusX = radiusX; 23 | RadiusY = radiusY; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Gdi/FontSignature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.InteropServices; 5 | 6 | namespace Vortice.Gdi 7 | { 8 | [StructLayout(LayoutKind.Sequential)] 9 | public struct FontSignature 10 | { 11 | public int fsUsb1; 12 | public int fsUsb2; 13 | public int fsUsb3; 14 | public int fsUsb4; 15 | public int fsCsb1; 16 | public int fsCsb2; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Gdi/LogFont.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Gdi; 5 | 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 7 | public class LogFont 8 | { 9 | public int lfHeight; 10 | public int lfWidth; 11 | public int lfEscapement; 12 | public int lfOrientation; 13 | public int lfWeight; 14 | public byte lfItalic; 15 | public byte lfUnderline; 16 | public byte lfStrikeOut; 17 | public byte lfCharSet; 18 | public byte lfOutPrecision; 19 | public byte lfClipPrecision; 20 | public byte lfQuality; 21 | public byte lfPitchAndFamily; 22 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)] 23 | public string lfFaceName; 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/GradientStop.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | /// 7 | /// Contains the position and color of a gradient stop. 8 | /// 9 | public partial struct GradientStop 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// A value that indicates the relative position of the gradient stop in the brush. This value must be in the [0.0f, 1.0f] range if the gradient stop is to be seen explicitly. 15 | /// The color of the gradient stop. 16 | public GradientStop(float position, in Color4 color) 17 | { 18 | Position = position; 19 | Color = color; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1Bitmap1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public unsafe partial class ID2D1Bitmap1 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1ColorContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public unsafe partial class ID2D1ColorContext 7 | { 8 | /// 9 | /// Gets the profile data. 10 | /// 11 | public byte[] ProfileData 12 | { 13 | get 14 | { 15 | byte[] profileData = new byte[ProfileSize]; 16 | GetProfile(profileData, (uint)profileData.Length); 17 | return profileData; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1CommandSink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial interface ID2D1CommandSink : IDisposable 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1Device.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial class ID2D1Device 7 | { 8 | public ID2D1DeviceContext CreateDeviceContext() => CreateDeviceContext(DeviceContextOptions.None); 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1Effect.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial class ID2D1Effect 7 | { 8 | /// 9 | /// Sets the input by using the output of a given effect. 10 | /// 11 | /// Index of the input 12 | /// Effect output to use as input 13 | /// To invalidate 14 | public void SetInputEffect(uint index, ID2D1Effect effect, bool invalidate = true) 15 | { 16 | using ID2D1Image output = effect.Output; 17 | SetInput(index, output, invalidate); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1EffectContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | public unsafe partial class ID2D1EffectContext 6 | { 7 | public Vector2 Dpi 8 | { 9 | get 10 | { 11 | GetDpi(out float dpiX, out float dpiY); 12 | return new Vector2(dpiX, dpiY); 13 | } 14 | } 15 | 16 | public T CheckFeatureSupport(Feature feature) where T : unmanaged 17 | { 18 | T featureSupport = default; 19 | CheckFeatureSupport(feature, &featureSupport, (uint)sizeof(T)); 20 | return featureSupport; 21 | } 22 | 23 | public bool CheckFeatureSupport(Feature feature, ref T featureSupport) where T : unmanaged 24 | { 25 | fixed (T* featureSupportPtr = &featureSupport) 26 | { 27 | return CheckFeatureSupport(feature, featureSupportPtr, (uint)sizeof(T)).Success; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1GeometryGroup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial class ID2D1GeometryGroup 7 | { 8 | public ID2D1Geometry[] GetSourceGeometry() 9 | { 10 | return GetSourceGeometry(SourceGeometryCount); 11 | } 12 | 13 | public ID2D1Geometry[] GetSourceGeometry(uint geometriesCount) 14 | { 15 | var geometries = new ID2D1Geometry[geometriesCount]; 16 | GetSourceGeometries(geometries, geometriesCount); 17 | return geometries; 18 | } 19 | 20 | public void GetSourceGeometry(ID2D1Geometry[] geometries) 21 | { 22 | GetSourceGeometries(geometries, (uint)geometries.Length); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1SimplifiedGeometrySink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial interface ID2D1SimplifiedGeometrySink : IDisposable 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1TessellationSink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial interface ID2D1TessellationSink : IDisposable 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/ID2D1TransformNode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | public partial interface ID2D1TransformNode : IDisposable 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/LinearGradientBrushProperties.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | /// 9 | /// Contains the starting point and endpoint of the gradient axis for an . 10 | /// 11 | public partial struct LinearGradientBrushProperties 12 | { 13 | /// 14 | /// Initializes a new instance of the struct. 15 | /// 16 | /// In the brush's coordinate space, the starting point of the gradient axis. 17 | /// In the brush's coordinate space, the endpoint of the gradient axis. 18 | public LinearGradientBrushProperties(in Vector2 startPoint, in Vector2 endPoint) 19 | { 20 | StartPoint = startPoint; 21 | EndPoint = endPoint; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/NativeFileAccess.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Win32; 5 | 6 | [Flags] 7 | internal enum NativeFileAccess : uint 8 | { 9 | None = 0, 10 | GenericRead = 0x80000000u, 11 | GenericWrite = 0x40000000u, 12 | } 13 | 14 | internal static class NativeFileAccessExtensions 15 | { 16 | public static NativeFileAccess ToNative(this FileAccess access) 17 | { 18 | switch (access) 19 | { 20 | case FileAccess.Read: 21 | return NativeFileAccess.GenericRead; 22 | 23 | case FileAccess.Write: 24 | return NativeFileAccess.GenericWrite; 25 | 26 | case FileAccess.ReadWrite: 27 | return NativeFileAccess.GenericRead | NativeFileAccess.GenericWrite; 28 | default: 29 | return NativeFileAccess.None; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/SvgLength.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Drawing; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | public partial struct SvgLength 9 | { 10 | /// 11 | /// Initializes a new instance of the struct. 12 | /// 13 | public SvgLength(float value, SvgLengthUnits units) 14 | { 15 | Value = value; 16 | Units = units; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/SvgPreserveAspectRatio.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Drawing; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | public partial struct SvgPreserveAspectRatio 9 | { 10 | /// 11 | /// Initializes a new instance of the struct. 12 | /// 13 | public SvgPreserveAspectRatio(bool defer, SvgAspectAlign align, SvgAspectScaling meetOrSlice) 14 | { 15 | Defer = defer; 16 | Align = align; 17 | MeetOrSlice = meetOrSlice; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/SvgViewbox.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Drawing; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | public partial struct SvgViewbox 9 | { 10 | /// 11 | /// Initializes a new instance of the struct. 12 | /// 13 | public SvgViewbox(float x, float y, float width, float height) 14 | { 15 | X = x; 16 | Y = y; 17 | Width = width; 18 | Height = height; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Triangle.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | 6 | namespace Vortice.Direct2D1; 7 | 8 | /// 9 | /// Contains the three vertices that describe a triangle. 10 | /// 11 | public partial struct Triangle 12 | { 13 | /// 14 | /// Initializes a new instance of the struct. 15 | /// 16 | /// The first vertex of a triangle. 17 | /// The second vertex of a triangle. 18 | /// The third vertex of a triangle. 19 | public Triangle(in Vector2 point1, in Vector2 point2, in Vector2 point3) 20 | { 21 | Point1 = point1; 22 | Point2 = point2; 23 | Point3 = point3; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/VertexRange.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct2D1; 5 | 6 | /// 7 | /// Defines a range of vertices that are used when rendering less than the full contents of a vertex buffer. 8 | /// 9 | public partial struct VertexRange 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The first vertex in the range to process. 15 | /// The number of vertices to use. 16 | public VertexRange(uint startVertex, uint vertexCount) 17 | { 18 | StartVertex = startVertex; 19 | VertexCount = vertexCount; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/Vortice.Direct2D1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | WIC, Direct2D1 and DirectWrite bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/ContainerFormat.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.WIC; 5 | 6 | public enum ContainerFormat 7 | { 8 | Bmp, 9 | Png, 10 | Ico, 11 | Jpeg, 12 | Tiff, 13 | Gif, 14 | Wmp, 15 | Dds, 16 | Adng, 17 | Heif, 18 | Webp, 19 | Raw 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/IWICBitmap.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Drawing; 5 | 6 | namespace Vortice.WIC; 7 | 8 | public unsafe partial class IWICBitmap 9 | { 10 | public IWICBitmapLock Lock(BitmapLockFlags flags) => Lock(null, flags); 11 | 12 | public IWICBitmapLock Lock(Rectangle lockRectangle, BitmapLockFlags flags = BitmapLockFlags.None) 13 | { 14 | return Lock(&lockRectangle, flags); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/IWICFormatConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.WIC; 5 | 6 | public partial class IWICFormatConverter 7 | { 8 | /// 9 | /// Initializes the format converter. 10 | /// 11 | /// The input bitmap to convert 12 | /// The destination format. 13 | /// 14 | public Result Initialize(IWICBitmapSource source, Guid dstFormat) 15 | { 16 | return Initialize(source, dstFormat, BitmapDitherType.None, null, 0.0, BitmapPaletteType.Custom); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/IWICImageEncoder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Direct2D1; 5 | 6 | namespace Vortice.WIC; 7 | 8 | public partial class IWICImageEncoder 9 | { 10 | public Result WriteFrame(ID2D1Image image, IWICBitmapFrameEncode frameEncode, WICImageParameters imageParameters) 11 | { 12 | return WriteFrame(image, frameEncode, ref imageParameters); 13 | } 14 | 15 | public Result WriteThumbnail(ID2D1Image image, IWICBitmapEncoder encoder, WICImageParameters imageParameters) 16 | { 17 | return WriteThumbnail(image, encoder, ref imageParameters); 18 | } 19 | 20 | public Result WriteFrameThumbnail(ID2D1Image image, IWICBitmapFrameEncode frameEncode, WICImageParameters imageParameters) 21 | { 22 | return WriteFrameThumbnail(image, frameEncode, ref imageParameters); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/IWICImagingFactory2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.WIC; 5 | 6 | public partial class IWICImagingFactory2 7 | { 8 | public IWICImagingFactory2() 9 | { 10 | ComUtilities.CreateComInstance( 11 | WICImagingFactoryClsid, 12 | ComContext.InprocServer, 13 | typeof(IWICImagingFactory2).GUID, 14 | this); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.Direct2D1/WIC/IWICPalette.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.WIC; 5 | 6 | partial class IWICPalette 7 | { 8 | public uint[] GetColors() 9 | { 10 | var colors = new uint[ColorCount]; 11 | GetColors((uint)colors.Length, colors, out _); 12 | return colors; 13 | } 14 | 15 | public void GetColors(uint[] colors) 16 | { 17 | GetColors((uint)colors.Length, colors, out _); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/CounterDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | /// 7 | /// Describes a counter. 8 | /// 9 | public partial struct CounterDescription 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// Type of query (see ). 15 | public CounterDescription(CounterKind counterKind) 16 | { 17 | CounterKind = counterKind; 18 | MiscFlags = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11CommandList.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11CommandList 7 | { 8 | internal ID3D11CommandList() 9 | : base(IntPtr.Zero) 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Device2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.DXGI; 5 | 6 | namespace Vortice.Direct3D11; 7 | 8 | public partial class ID3D11Device2 9 | { 10 | public unsafe ID3D11DeviceContext2 CreateDeferredContext2() 11 | { 12 | return CreateDeferredContext2(0); 13 | } 14 | 15 | public uint CheckMultisampleQualityLevels1(Format format, uint sampleCount) 16 | { 17 | return CheckMultisampleQualityLevels1(format, sampleCount, CheckMultisampleQualityLevelsFlags.TiledResource); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Device4.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11Device4 7 | { 8 | public int RegisterDeviceRemovedEvent(WaitHandle waitHandle) 9 | { 10 | return RegisterDeviceRemovedEvent(waitHandle.SafeWaitHandle.DangerousGetHandle()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11DeviceContext3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11DeviceContext3 7 | { 8 | public void Flush1(ContextType contextType, WaitHandle waitHandle) 9 | { 10 | Flush1(contextType, waitHandle.SafeWaitHandle.DangerousGetHandle()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Fence.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using SharpGen.Runtime.Win32; 5 | 6 | namespace Vortice.Direct3D11; 7 | 8 | public partial class ID3D11Fence 9 | { 10 | private const int GENERIC_ALL = 0x10000000; 11 | 12 | public IntPtr CreateSharedHandle(SecurityAttributes? attributes, string name) 13 | { 14 | return CreateSharedHandle(attributes, GENERIC_ALL, name); 15 | } 16 | 17 | public void SetEventOnCompletion(ulong value, WaitHandle waitHandle) 18 | { 19 | SetEventOnCompletion(value, waitHandle.SafeWaitHandle.DangerousGetHandle()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Texture1D.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11Texture1D 7 | { 8 | /// 9 | public override uint CalculateSubResourceIndex(uint mipSlice, uint arraySlice, out uint mipSize) 10 | { 11 | Texture1DDescription description = GetDescription(); 12 | mipSize = D3D11.CalculateMipSize(mipSlice, description.Width); 13 | return D3D11.CalculateSubResourceIndex(mipSlice, arraySlice, description.MipLevels); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Texture2D.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11Texture2D 7 | { 8 | /// 9 | public override uint CalculateSubResourceIndex(uint mipSlice, uint arraySlice, out uint mipSize) 10 | { 11 | var desc = GetDescription(); 12 | mipSize = D3D11.CalculateMipSize(mipSlice, desc.Height); 13 | return D3D11.CalculateSubResourceIndex(mipSlice, arraySlice, desc.MipLevels); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11Texture3D.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11Texture3D 7 | { 8 | /// 9 | public override uint CalculateSubResourceIndex(uint mipSlice, uint arraySlice, out uint mipSize) 10 | { 11 | var desc = GetDescription(); 12 | mipSize = D3D11.CalculateMipSize(mipSlice, desc.Depth); 13 | return D3D11.CalculateSubResourceIndex(mipSlice, arraySlice, desc.MipLevels); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11VideoContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public unsafe partial class ID3D11VideoContext 7 | { 8 | //public AuthenticatedConfigureOutput ConfigureAuthenticatedChannel(ID3D11AuthenticatedChannel channel, int inputSize, IntPtr input) 9 | //{ 10 | // ConfigureAuthenticatedChannel(channel, inputSize, input, out AuthenticatedConfigureOutput output).CheckError(); 11 | // return output; 12 | //} 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11VideoDecoder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11VideoDecoder 7 | { 8 | public VideoDecoderDescription CreationDescription 9 | { 10 | get 11 | { 12 | GetCreationParameters(out VideoDecoderDescription desc, out _); 13 | return desc; 14 | } 15 | } 16 | 17 | public VideoDecoderConfig CreationConfig 18 | { 19 | get 20 | { 21 | GetCreationParameters(out _, out VideoDecoderConfig config); 22 | return config; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11VideoDevice1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11VideoDevice1 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/ID3D11VideoDevice2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | public partial class ID3D11VideoDevice2 7 | { 8 | public unsafe T CheckFeatureSupport(FeatureVideo feature) where T : unmanaged 9 | { 10 | T featureSupport = default; 11 | CheckFeatureSupport(feature, &featureSupport, (uint)sizeof(T)); 12 | return featureSupport; 13 | } 14 | 15 | public unsafe bool CheckFeatureSupport(FeatureVideo feature, ref T featureSupport) where T : unmanaged 16 | { 17 | fixed (T* featureSupportPtr = &featureSupport) 18 | { 19 | return CheckFeatureSupport(feature, featureSupportPtr, (uint)sizeof(T)).Success; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/QueryDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | /// 7 | /// Describes a query. 8 | /// 9 | public partial struct QueryDescription 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// Type of query (see ). 15 | /// Miscellaneous flags (see ). 16 | public QueryDescription(QueryType queryType, QueryFlags miscFlags = QueryFlags.None) 17 | { 18 | QueryType = queryType; 19 | MiscFlags = miscFlags; 20 | } 21 | } -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/QueryDescription1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | /// 7 | /// Describes a query. 8 | /// 9 | public partial struct QueryDescription1 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// Type of query (see ). 15 | /// Miscellaneous flags (see ). 16 | /// 17 | public QueryDescription1(QueryType queryType, QueryFlags miscFlags = QueryFlags.None, ContextType contextType = ContextType.All) 18 | { 19 | QueryType = queryType; 20 | MiscFlags = miscFlags; 21 | ContextType = contextType; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/Shader/ID3D11ShaderReflectionConstantBuffer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11.Shader; 5 | 6 | public partial class ID3D11ShaderReflectionConstantBuffer 7 | { 8 | private ID3D11ShaderReflectionVariable[] _variables; 9 | 10 | public ID3D11ShaderReflectionVariable[] Variables 11 | { 12 | get 13 | { 14 | if (_variables == null) 15 | { 16 | _variables = new ID3D11ShaderReflectionVariable[Description.VariableCount]; 17 | for (uint i = 0; i < Description.VariableCount; i++) 18 | { 19 | _variables[i] = GetVariableByIndex(i); 20 | } 21 | } 22 | 23 | return _variables; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/Shader/RegisterComponentMaskFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11.Shader; 5 | 6 | [Flags] 7 | public enum RegisterComponentMaskFlags : byte 8 | { 9 | None = 0, 10 | ComponentX = 1, 11 | ComponentY = 2, 12 | ComponentZ = 4, 13 | ComponentW = 8, 14 | All = ComponentX | ComponentY | ComponentZ | ComponentW, 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/Shader/ShaderDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11.Shader; 5 | 6 | public partial struct ShaderDescription 7 | { 8 | public ShaderVersionType Type => (ShaderVersionType)(((Version) >> 16) & 0xffff); 9 | public uint Major => ((Version) >> 4) & 0xf; 10 | public uint Minor => ((Version) >> 0) & 0xf; 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/SharedResourceFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D11; 5 | 6 | [Flags] 7 | public enum SharedResourceFlags : uint 8 | { 9 | None = 0, 10 | Write = 1, 11 | Read = 0x80000000, 12 | GenericWrite = 0x40000000, 13 | GenericRead = 0x80000000, 14 | GenericExecute = 0x20000000, 15 | GenericAll = 0x10000000 16 | } -------------------------------------------------------------------------------- /src/Vortice.Direct3D11/Vortice.Direct3D11.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Direct3D11 bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/DepthStencilValue.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct DepthStencilValue 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// Specifies the depth value. 12 | /// Specifies the stencil value. 13 | public DepthStencilValue(float depth, byte stencil = 0) 14 | { 15 | Depth = depth; 16 | Stencil = stencil; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/DescriptorHeapDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct DescriptorHeapDescription 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// The heap type. 12 | /// The descriptor count. 13 | /// The optional heap flags. 14 | /// Multi GPU node mask. 15 | public DescriptorHeapDescription(DescriptorHeapType type, uint descriptorCount, DescriptorHeapFlags flags = DescriptorHeapFlags.None, uint nodeMask = 0) 16 | { 17 | Type = type; 18 | DescriptorCount = descriptorCount; 19 | Flags = flags; 20 | NodeMask = nodeMask; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/DredAutoBreadcrumbsOutput.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class DredAutoBreadcrumbsOutput 7 | { 8 | public AutoBreadcrumbNode? HeadAutoBreadcrumbNode { get; set; } 9 | 10 | #region Marshal 11 | internal unsafe struct __Native 12 | { 13 | public AutoBreadcrumbNode.__Native* pHeadAutoBreadcrumbNode; 14 | } 15 | 16 | internal unsafe void __MarshalFree(ref __Native @ref) 17 | { 18 | HeadAutoBreadcrumbNode?.__MarshalFree(@ref.pHeadAutoBreadcrumbNode); 19 | } 20 | 21 | internal unsafe void __MarshalFrom(ref __Native @ref) 22 | { 23 | HeadAutoBreadcrumbNode?.__MarshalFrom(@ref.pHeadAutoBreadcrumbNode); 24 | } 25 | 26 | internal unsafe void __MarshalTo(ref __Native @ref) 27 | { 28 | HeadAutoBreadcrumbNode?.__MarshalTo(@ref.pHeadAutoBreadcrumbNode); 29 | } 30 | #endregion 31 | } 32 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/GpuVirtualAddressAndStride.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes a GPU virtual address and indexing stride. 8 | /// 9 | public partial struct GpuVirtualAddressAndStride 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The beginning of the virtual address range. 15 | /// Defines indexing stride, such as for vertices. Only the bottom 32 bits are used. The field is 64 bits to make alignment of containing structures consistent everywhere. 16 | public GpuVirtualAddressAndStride(ulong startAddress, ulong strideInBytes) 17 | { 18 | StartAddress = startAddress; 19 | StrideInBytes = strideInBytes; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/GpuVirtualAddressRange.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes a GPU virtual address range. 8 | /// 9 | public partial struct GpuVirtualAddressRange 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The beginning of the virtual address range. 15 | /// The size of the virtual address range, in bytes. 16 | public GpuVirtualAddressRange(ulong startAddress, ulong sizeInBytes) 17 | { 18 | StartAddress = startAddress; 19 | SizeInBytes = sizeInBytes; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12Device11.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12Device11 7 | { 8 | public void CreateSampler2(SamplerDescription2 desc, CpuDescriptorHandle destDescriptor) 9 | { 10 | CreateSampler2(ref desc, destDescriptor); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12Fence.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12Fence 7 | { 8 | public Result SetEventOnCompletion(ulong value) 9 | { 10 | return SetEventOnCompletion(value, IntPtr.Zero); 11 | } 12 | 13 | public Result SetEventOnCompletion(ulong value, WaitHandle? waitHandle) 14 | { 15 | if (waitHandle == null) 16 | { 17 | return SetEventOnCompletion(value, IntPtr.Zero); 18 | } 19 | else 20 | { 21 | return SetEventOnCompletion(value, waitHandle!.SafeWaitHandle.DangerousGetHandle()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12GraphicsCommandList2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12GraphicsCommandList2 7 | { 8 | public void WriteBufferImmediate(WriteBufferImmediateParameter[] @params, WriteBufferImmediateMode[]? modes = null) 9 | { 10 | if (modes != null && @params.Length != modes.Length) 11 | { 12 | throw new ArgumentException($"If {nameof(modes)} is not null, it must have the same length as {nameof(@params)}", nameof(modes)); 13 | } 14 | 15 | WriteBufferImmediate_((uint)@params.Length, @params, modes); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12Object.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12Object 7 | { 8 | /// 9 | /// Gets or sets a name with the device object. 10 | /// 11 | /// 12 | /// This name is for use in debug diagnostics and tools. 13 | /// 14 | public unsafe string Name 15 | { 16 | get 17 | { 18 | byte* pname = stackalloc byte[1024]; 19 | uint size = 1024 - 1; 20 | if (GetPrivateData(CommonGuid.DebugObjectNameW, ref size, pname).Failure) 21 | { 22 | return string.Empty; 23 | } 24 | 25 | pname[size] = 0; 26 | return Marshal.PtrToStringUni(new IntPtr(pname))!; 27 | } 28 | set 29 | { 30 | SetName(value ?? string.Empty); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12PipelineLibrary.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12PipelineLibrary 7 | { 8 | public ID3D12PipelineState LoadComputePipeline(string name, ComputePipelineStateDescription description) 9 | { 10 | return LoadComputePipeline(name, description, typeof(ID3D12PipelineState).GUID); 11 | } 12 | 13 | public unsafe ID3D12PipelineState LoadGraphicsPipeline(string name, GraphicsPipelineStateDescription description) 14 | { 15 | return LoadGraphicsPipeline(name, description, typeof(ID3D12PipelineState).GUID); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12PipelineLibrary1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12PipelineLibrary1 7 | { 8 | public ID3D12PipelineState LoadPipeline(string name, PipelineStateStreamDescription description) 9 | { 10 | return LoadPipeline(name, description, typeof(ID3D12PipelineState).GUID); 11 | } 12 | 13 | public ID3D12PipelineState LoadPipeline(string name, ref PipelineStateStreamDescription description) 14 | { 15 | return LoadPipeline(name, description, typeof(ID3D12PipelineState).GUID); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12Resource1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial class ID3D12Resource1 7 | { 8 | private ID3D12ProtectedResourceSession _protectedResourceSession; 9 | 10 | public ID3D12ProtectedResourceSession? ProtectedResourceSession 11 | { 12 | get 13 | { 14 | if (_protectedResourceSession != null) 15 | return _protectedResourceSession; 16 | 17 | if (GetProtectedResourceSession(typeof(ID3D12ProtectedResourceSession).GUID, out IntPtr nativePtr).Failure) 18 | { 19 | return null; 20 | } 21 | 22 | _protectedResourceSession = new ID3D12ProtectedResourceSession(nativePtr); 23 | return _protectedResourceSession; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ID3D12VersionedRootSignatureDeserializer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | namespace Vortice.Direct3D12; 7 | 8 | public unsafe partial class ID3D12VersionedRootSignatureDeserializer 9 | { 10 | public VersionedRootSignatureDescription GetRootSignatureDescAtVersion(RootSignatureVersion convertToVersion) 11 | { 12 | IntPtr ptr = GetRootSignatureDescAtVersion_(convertToVersion); 13 | 14 | // Marshal the result. 15 | var result = new VersionedRootSignatureDescription(); 16 | result.__MarshalFrom(ref Unsafe.AsRef(ptr.ToPointer())); 17 | return result; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/IStateSubObjectDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public interface IStateSubObjectDescription 7 | { 8 | StateSubObjectType SubObjectType { get; } 9 | } 10 | 11 | internal interface IStateSubObjectDescriptionMarshal 12 | { 13 | IntPtr __MarshalAlloc(Dictionary subObjectLookup); 14 | void __MarshalFree(ref IntPtr pDesc); 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/MipRegion.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct MipRegion 7 | { 8 | /// 9 | /// Initializes a new instance of structure. 10 | /// 11 | /// The width component of the region. 12 | /// The height component of the region. 13 | /// The depth component of the region. 14 | public MipRegion(uint width, uint height, uint depth) 15 | { 16 | Width = width; 17 | Height = height; 18 | Depth = depth; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ProtectedResourceSessionDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct ProtectedResourceSessionDescription 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// The node mask. 12 | /// Optional flags 13 | public ProtectedResourceSessionDescription(uint nodeMask, ProtectedResourceSessionFlags flags = ProtectedResourceSessionFlags.None) 14 | { 15 | NodeMask = nodeMask; 16 | Flags = flags; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/RenderPassBeginningAccessClearParameters.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes the clear value to which resource(s) should be cleared at the beginning of a render pass. 8 | /// 9 | public partial struct RenderPassBeginningAccessClearParameters 10 | { 11 | /// 12 | /// Initialize new instance of struct. 13 | /// 14 | /// The clear value to which the resource(s) should be cleared. 15 | public RenderPassBeginningAccessClearParameters(in ClearValue clearValue) 16 | { 17 | ClearValue = clearValue; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ResourceAliasingBarrier.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct ResourceAliasingBarrier 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// The resource before. 12 | /// The resource after. 13 | /// resourceBefore 14 | public ResourceAliasingBarrier(ID3D12Resource? resourceBefore, ID3D12Resource? resourceAfter) 15 | { 16 | ResourceBeforePointer = resourceBefore != null ? resourceBefore.NativePointer : IntPtr.Zero; 17 | ResourceAfterPointer = resourceAfter != null ? resourceAfter.NativePointer : IntPtr.Zero; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ResourceAllocationInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes parameters needed to allocate resources. 8 | /// 9 | public partial struct ResourceAllocationInfo 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The size, in bytes, of the resource. 15 | /// The alignment value for the resource; one of 4KB (4096), 64KB (65536) and 4MB (4194304) alignment. 16 | public ResourceAllocationInfo(ulong sizeInBytes, ulong alignment) 17 | { 18 | SizeInBytes = sizeInBytes; 19 | Alignment = alignment; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/ResourceUnorderedAccessViewBarrier.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | public partial struct ResourceUnorderedAccessViewBarrier 7 | { 8 | /// 9 | /// Initializes a new instance of the struct. 10 | /// 11 | /// The resource. 12 | /// resourceBefore 13 | public ResourceUnorderedAccessViewBarrier(ID3D12Resource? resource) 14 | { 15 | ResourcePointer = resource != null ? resource.NativePointer : IntPtr.Zero; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/RootDescriptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes descriptors inline in the root signature version 1.0 that appear in shaders. 8 | /// 9 | public partial struct RootDescriptor 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The shader register. 15 | /// The register space. 16 | public RootDescriptor(uint shaderRegister, uint registerSpace) 17 | { 18 | ShaderRegister = shaderRegister; 19 | RegisterSpace = registerSpace; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/SamplePosition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes a sub-pixel sample position for use with programmable sample positions. 8 | /// 9 | public partial struct SamplePosition 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// A signed sub-pixel coordinate value in the X axis. 15 | /// A signed sub-pixel coordinate value in the Y axis. 16 | public SamplePosition(byte x, byte y) 17 | { 18 | X = x; 19 | Y = y; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Shader/ID3D12ShaderReflectionConstantBuffer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12.Shader; 5 | 6 | public partial class ID3D12ShaderReflectionConstantBuffer 7 | { 8 | private ID3D12ShaderReflectionVariable[] _variables; 9 | 10 | public ID3D12ShaderReflectionVariable[] Variables 11 | { 12 | get 13 | { 14 | if (_variables == null) 15 | { 16 | _variables = new ID3D12ShaderReflectionVariable[Description.VariableCount]; 17 | for (uint i = 0; i < Description.VariableCount; i++) 18 | { 19 | _variables[i] = GetVariableByIndex(i); 20 | } 21 | } 22 | 23 | return _variables; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Shader/RegisterComponentMaskFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12.Shader; 5 | 6 | [Flags] 7 | public enum RegisterComponentMaskFlags : byte 8 | { 9 | None = 0, 10 | ComponentX = 1, 11 | ComponentY = 2, 12 | ComponentZ = 4, 13 | ComponentW = 8, 14 | All = ComponentX | ComponentY | ComponentZ | ComponentW, 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Shader/ShaderDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12.Shader; 5 | 6 | public partial struct ShaderDescription 7 | { 8 | public ShaderVersionType Type => (ShaderVersionType)(((Version) >> 16) & 0xffff); 9 | public uint Major => ((Version) >> 4) & 0xf; 10 | public uint Minor => ((Version) >> 0) & 0xf; 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/TiledResourceCoordinate.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes the coordinates of a tiled resource. 8 | /// 9 | public partial struct TiledResourceCoordinate 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// The x-coordinate of the tiled resource. 15 | /// The y-coordinate of the tiled resource. 16 | /// The z-coordinate of the tiled resource. 17 | /// The index of the subresource for the tiled resource. 18 | public TiledResourceCoordinate(uint x, uint y, uint z, uint subresource = 0) 19 | { 20 | X = x; 21 | Y = y; 22 | Z = z; 23 | Subresource = subresource; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/VertexBufferView.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12; 5 | 6 | /// 7 | /// Describes a vertex buffer view. 8 | /// 9 | public partial struct VertexBufferView 10 | { 11 | /// 12 | /// Initializes a new instance of the struct. 13 | /// 14 | /// Specifies a gpu virtual address that identifies the address of the buffer. 15 | /// Specifies the size in bytes of the buffer. 16 | /// Specifies the size in bytes of each vertex entry. 17 | public VertexBufferView(ulong bufferLocation, uint sizeInBytes, uint strideInBytes) 18 | { 19 | BufferLocation = bufferLocation; 20 | SizeInBytes = sizeInBytes; 21 | StrideInBytes = strideInBytes; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Video/VideoEncoderAv1ReferencePictureWarpedMotionInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12.Video; 5 | 6 | public unsafe partial struct VideoEncoderAv1ReferencePictureWarpedMotionInfo 7 | { 8 | public VideoEncoderAv1ReferenceWarpedMotionTransformation TransformationType; 9 | public fixed int TransformationMatrix[8]; 10 | public RawBool InvalidAffineSet; 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Video/VideoEncoderAv1SegmentData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D12.Video; 5 | 6 | public unsafe partial struct VideoEncoderAv1SegmentData 7 | { 8 | public ulong EnabledFeatures; 9 | 10 | public fixed long FeatureValue[8]; 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D12/Vortice.Direct3D12.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Direct3D12 bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D9/D3D9.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D9; 5 | 6 | public partial class D3D9 7 | { 8 | public static IDirect3D9 Direct3DCreate9() => Direct3DCreate9(SdkVersion); 9 | 10 | public static Result Direct3DCreate9Ex(out IDirect3D9Ex result) => Direct3DCreate9Ex(SdkVersion, out result); 11 | 12 | public static IDirect3D9Ex Direct3DCreate9Ex() 13 | { 14 | Direct3DCreate9Ex(SdkVersion, out IDirect3D9Ex result).CheckError(); 15 | return result; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D9/Helpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.CompilerServices; 5 | using Vortice.Mathematics; 6 | 7 | namespace Vortice.Direct3D9; 8 | 9 | internal static class Helpers 10 | { 11 | public static readonly Guid DebugObjectName = new(0x429B8C22, 0x9188, 0x4B0C, 0x87, 0x42, 0xAC, 0xB0, 0xBF, 0x85, 0xC2, 0x00); 12 | 13 | /// 14 | /// Converts the color into a packed integer. 15 | /// 16 | /// A packed integer containing all four color components. 17 | public static int ToBgra(in Color color) 18 | { 19 | int value = color.B; 20 | value |= color.G << 8; 21 | value |= color.R << 16; 22 | value |= color.A << 24; 23 | 24 | return (int)value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D9/IDirect3D9.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D9; 5 | 6 | public partial class IDirect3D9 7 | { 8 | public IDirect3DDevice9 CreateDevice(uint adapter, DeviceType deviceType, IntPtr focusWindow, CreateFlags createFlags, PresentParameters presentationParameters) 9 | { 10 | return CreateDevice(adapter, deviceType, focusWindow, (int)createFlags, ref presentationParameters); 11 | } 12 | 13 | /// 14 | /// Get the physical display adapters present in the system when this was instantiated. 15 | /// 16 | /// The adapter. 17 | /// The physical display adapters 18 | public AdapterIdentifier GetAdapterIdentifier(uint adapter) 19 | { 20 | return GetAdapterIdentifier(adapter, 0); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D9/PaletteEntry.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D9; 5 | 6 | /// 7 | /// The PaletteEntry struct contains the color and usage of an entry in a logical palette. 8 | /// 9 | [StructLayout(LayoutKind.Sequential, Pack = 0)] 10 | public struct PaletteEntry 11 | { 12 | /// 13 | /// The red intensity value for the palette entry. 14 | /// 15 | public byte Red; 16 | 17 | /// 18 | /// The green intensity value for the palette entry. 19 | /// 20 | public byte Green; 21 | 22 | /// 23 | /// The blue intensity value for the palette entry. 24 | /// 25 | public byte Blue; 26 | 27 | /// 28 | /// Indicates how the palette entry is to be used. 29 | /// TODO define an enum for flags 30 | /// 31 | public byte Flags; 32 | } 33 | -------------------------------------------------------------------------------- /src/Vortice.Direct3D9/Vortice.Direct3D9.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Direct3D9 bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Vortice.DirectComposition/Documentation.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Vortice.DirectComposition/IDCompositionDesktopDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectComposition; 5 | 6 | public partial class IDCompositionDesktopDevice 7 | { 8 | public IUnknown CreateSurfaceFromHandle(IntPtr handle) 9 | { 10 | CreateSurfaceFromHandle(handle, out IUnknown surface).CheckError(); 11 | return surface; 12 | } 13 | 14 | public IUnknown CreateSurfaceFromHwnd(IntPtr hwnd) 15 | { 16 | CreateSurfaceFromHwnd(hwnd, out IUnknown surface).CheckError(); 17 | return surface; 18 | } 19 | 20 | public IDCompositionTarget CreateSurfaceFromHwnd(IntPtr hwnd, bool topmost) 21 | { 22 | CreateTargetForHwnd(hwnd, topmost, out IDCompositionTarget target).CheckError(); 23 | return target; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.DirectComposition/IDCompositionSurfaceFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.DXGI; 5 | 6 | namespace Vortice.DirectComposition; 7 | 8 | public partial class IDCompositionSurfaceFactory 9 | { 10 | public IDCompositionSurface CreateSurface(uint width, uint height, Format pixelFormat, AlphaMode alphaMode) 11 | { 12 | CreateSurface(width, height, pixelFormat, alphaMode, out IDCompositionSurface surface).CheckError(); 13 | return surface; 14 | } 15 | 16 | public IDCompositionVirtualSurface CreateVirtualSurface(uint initialWidth, uint initialHeight, Format pixelFormat, AlphaMode alphaMode) 17 | { 18 | CreateVirtualSurface(initialWidth, initialHeight, pixelFormat, alphaMode, out IDCompositionVirtualSurface virtualSurface).CheckError(); 19 | return virtualSurface; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.DirectComposition/IDCompositionVisual.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | 6 | namespace Vortice.DirectComposition; 7 | 8 | public partial class IDCompositionVisual 9 | { 10 | public Result SetTransform(Matrix3x2 matrix) => SetTransform(ref matrix); 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.DirectComposition/IDCompositionVisual3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Numerics; 5 | 6 | namespace Vortice.DirectComposition; 7 | 8 | public partial class IDCompositionVisual3 9 | { 10 | public Result SetTransform(Matrix4x4 matrix) => SetTransform(ref matrix); 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.DirectInput/EffectInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Distributed under the MIT license. See the LICENSE file in the project root for more information. 3 | 4 | namespace Vortice.DirectInput; 5 | 6 | public partial class EffectInfo 7 | { 8 | #region Marshal 9 | internal static unsafe __Native __NewNative() 10 | { 11 | __Native native = default; 12 | native.Size = sizeof(__Native); 13 | return native; 14 | } 15 | #endregion Marshal 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.DirectInput/PredefinedDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and contributors. 2 | // Distributed under the MIT license. See the LICENSE file in the project root for more information. 3 | 4 | namespace Vortice.DirectInput; 5 | 6 | public enum PredefinedDevice 7 | { 8 | SysMouse, 9 | SysKeyboard, 10 | Joystick, 11 | SysMouseEm, 12 | SysMouseEm2, 13 | SysKeyboardEm, 14 | SysKeyboardEm2, 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.DirectInput/Vortice.DirectInput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | DirectInput bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/IBindingDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public interface IBindingDescription 7 | { 8 | BindingType BindingType { get; } 9 | } 10 | 11 | internal interface IBindingDescriptionMarshal 12 | { 13 | IntPtr __MarshalAlloc(); 14 | 15 | void __MarshalFree(ref IntPtr pDesc); 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/IDMLOperatorInitializer.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public partial class IDMLOperatorInitializer 7 | { 8 | /// 9 | /// Resets the initializer to handle initialization of a new set of operators. 10 | /// 11 | /// 12 | /// 13 | /// See Microsoft Docs: 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | public Result Reset(params IDMLCompiledOperator[]? operators) 20 | { 21 | return Reset((uint)(operators?.Length ?? 0), operators); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/IGraphEdgeDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public interface IGraphEdgeDescription 7 | { 8 | GraphEdgeType GraphEdgeType { get; } 9 | } 10 | 11 | internal interface IGraphEdgeDescriptionMarshal 12 | { 13 | IntPtr __MarshalAlloc(); 14 | 15 | void __MarshalFree(ref IntPtr pDesc); 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/IGraphNodeDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public interface IGraphNodeDescription 7 | { 8 | GraphNodeType GraphNodeType { get; } 9 | } 10 | 11 | internal interface IGraphNodeDescriptionMarshal 12 | { 13 | IntPtr __MarshalAlloc(); 14 | 15 | void __MarshalFree(ref IntPtr pDesc); 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/IOperatorDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public interface IOperatorDescription 7 | { 8 | OperatorType OperatorType { get; } 9 | } 10 | 11 | public interface IFusableActivationOperatorDescription : IOperatorDescription 12 | { 13 | TensorDescription? InputTensor { get; } 14 | 15 | TensorDescription? OutputTensor { get; } 16 | } 17 | 18 | internal interface IOperatorDescriptionMarshal 19 | { 20 | IntPtr __MarshalAlloc(); 21 | 22 | void __MarshalFree(ref IntPtr pDesc); 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/ITensorDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public interface ITensorDescription 7 | { 8 | TensorType TensorType { get; } 9 | } 10 | 11 | internal interface ITensorDescriptionMarshal 12 | { 13 | IntPtr __MarshalAlloc(); 14 | 15 | void __MarshalFree(ref IntPtr pDesc); 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/ScaleBias.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public partial struct ScaleBias 7 | { 8 | /// 9 | /// Construts a with the given scale and bias. 10 | /// 11 | /// 12 | /// 13 | public ScaleBias(float scale = 1.0f, float bias = 0.0f) 14 | { 15 | Scale = scale; 16 | Bias = bias; 17 | } 18 | 19 | /// 20 | public override string ToString() => $"Scale={Scale} Bias={Bias}"; 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/Size2D.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Aaron Sun, Amer Koleci, and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectML; 5 | 6 | public partial struct Size2D 7 | { 8 | /// 9 | /// Constructs a with the given width and height. 10 | /// 11 | /// 12 | /// 13 | public Size2D(uint width, uint height) 14 | { 15 | Width = width; 16 | Height = height; 17 | } 18 | 19 | /// 20 | public override readonly string ToString() => $"Width={Width} Height={Height}"; 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/linux-x64/libdirectml.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/linux-x64/libdirectml.so -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-arm/native/DirectML.Debug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-arm/native/DirectML.Debug.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-arm/native/DirectML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-arm/native/DirectML.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-arm64/native/DirectML.Debug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-arm64/native/DirectML.Debug.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-arm64/native/DirectML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-arm64/native/DirectML.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-x64/native/DirectML.Debug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-x64/native/DirectML.Debug.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-x64/native/DirectML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-x64/native/DirectML.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-x86/native/DirectML.Debug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-x86/native/DirectML.Debug.dll -------------------------------------------------------------------------------- /src/Vortice.DirectML/runtimes/win-x86/native/DirectML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectML/runtimes/win-x86/native/DirectML.dll -------------------------------------------------------------------------------- /src/Vortice.DirectSound/Vortice.DirectSound.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | DirectSound bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/IDStorageQueue.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DirectStorage; 5 | 6 | public partial class IDStorageQueue 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-arm/native/dstorage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-arm/native/dstorage.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-arm/native/dstoragecore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-arm/native/dstoragecore.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-arm64/native/dstorage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-arm64/native/dstorage.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-arm64/native/dstoragecore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-arm64/native/dstoragecore.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-x64/native/dstorage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-x64/native/dstorage.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-x64/native/dstoragecore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-x64/native/dstoragecore.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-x86/native/dstorage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-x86/native/dstorage.dll -------------------------------------------------------------------------------- /src/Vortice.DirectStorage/runtimes/win-x86/native/dstoragecore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.DirectStorage/runtimes/win-x86/native/dstoragecore.dll -------------------------------------------------------------------------------- /src/Vortice.DirectX/DXGI/JpegAcHuffmanTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | /// 7 | /// Describes a JPEG DC huffman table. 8 | /// 9 | public unsafe partial struct JpegAcHuffmanTable 10 | { 11 | /// 12 | /// The number of codes for each code length. 13 | /// 14 | public fixed byte CodeCounts[12]; 15 | /// 16 | /// The Huffman code values, in order of increasing code length. 17 | /// 18 | public fixed byte CodeValues[12]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/DXGI/JpegDcHuffmanTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | /// 7 | /// Describes a JPEG AC huffman table. 8 | /// 9 | public unsafe partial struct JpegDcHuffmanTable 10 | { 11 | /// 12 | /// The number of codes for each code length. 13 | /// 14 | public fixed byte CodeCounts[16]; 15 | /// 16 | /// The Huffman code values, in order of increasing code length. 17 | /// 18 | public fixed byte CodeValues[162]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/DXGI/JpegQuantizationTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | /// 7 | /// Describes a JPEG quantization table. 8 | /// 9 | public unsafe partial struct JpegQuantizationTable 10 | { 11 | /// 12 | /// An array of bytes containing the elements of the quantization table. 13 | /// 14 | public fixed byte Elements[64]; 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/DXGI/Rational.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial struct Rational 7 | { 8 | /// 9 | /// Initialize instance of struct. 10 | /// 11 | /// 12 | /// 13 | public Rational(uint numerator, uint denominator) 14 | { 15 | Numerator = numerator; 16 | Denominator = denominator; 17 | } 18 | 19 | public override readonly string ToString() => $"Numerator: {Numerator}, Denominator: {Denominator}"; 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/DXGI/SampleDescription.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.DXGI; 5 | 6 | public partial struct SampleDescription 7 | { 8 | /// 9 | /// A with Count=1 and Quality=0. 10 | /// 11 | public static readonly SampleDescription Default = new(1, 0); 12 | 13 | /// 14 | /// Create new instance of struct. 15 | /// 16 | /// 17 | /// 18 | public SampleDescription(uint count, uint quality) 19 | { 20 | Count = count; 21 | Quality = quality; 22 | } 23 | 24 | public override readonly string ToString() => $"Count: {Count}, Quality: {Quality}"; 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/DataRectangle.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice; 5 | 6 | /// 7 | /// Provides access to data organized in 2D. 8 | /// 9 | [StructLayout(LayoutKind.Sequential)] 10 | public readonly struct DataRectangle 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The data pointer. 16 | /// The pitch. 17 | public DataRectangle(IntPtr dataPointer, uint pitch) 18 | { 19 | DataPointer = dataPointer; 20 | Pitch = pitch; 21 | } 22 | 23 | /// 24 | /// Pointer to the data. 25 | /// 26 | public readonly IntPtr DataPointer; 27 | 28 | /// 29 | /// Gets the number of bytes per row. 30 | /// 31 | public readonly uint Pitch; 32 | } 33 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Direct3D/IncludeShadow.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Direct3D; 5 | 6 | /// 7 | /// Shadow callback for . 8 | /// 9 | internal sealed class IncludeShadow : CppObjectShadow 10 | { 11 | internal readonly Dictionary _frames = new(); 12 | 13 | internal struct Frame : IDisposable 14 | { 15 | public Frame(Stream stream, GCHandle handle) 16 | { 17 | Stream = stream; 18 | _handle = handle; 19 | } 20 | 21 | public readonly Stream Stream; 22 | private GCHandle _handle; 23 | 24 | public void Dispose() 25 | { 26 | if (_handle.IsAllocated) 27 | _handle.Free(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Multimedia/AudioEndpointRole.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Multimedia; 5 | 6 | /// 7 | /// This enumeration defines constants that indicate the role that the system has assigned to an audio endpoint device. 8 | /// 9 | /// dd370842 10 | /// ERole 11 | /// ERole 12 | public enum AudioEndpointRole 13 | { 14 | /// 15 | /// Games, system notification sounds, and voice commands 16 | /// 17 | Console, 18 | 19 | /// 20 | /// Music, movies, narration, and live music recording. 21 | /// 22 | Multimedia, 23 | 24 | /// 25 | /// Voice communications (talking to another person). 26 | /// 27 | Communications, 28 | } 29 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Win32/BitmapInfoHeader.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Win32; 5 | 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct BitmapInfoHeader 8 | { 9 | public int SizeInBytes; 10 | public int Width; 11 | public int Height; 12 | public short PlaneCount; 13 | public short BitCount; 14 | public int Compression; 15 | public int SizeImage; 16 | public int XPixelsPerMeter; 17 | public int YPixelsPerMeter; 18 | public int ColorUsedCount; 19 | public int ColorImportantCount; 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Win32/ByHandleFileInformation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Win32; 5 | 6 | /// 7 | /// BY_HANDLE_FILE_INFORMATION 8 | /// 9 | public partial struct ByHandleFileInformation 10 | { 11 | public uint FileAttributes; 12 | public ulong CreationTime; 13 | public ulong LastAccessTime; 14 | public ulong LastWriteTime; 15 | public uint VolumeSerialNumber; 16 | public uint FileSizeHigh; 17 | public uint FileSizeLow; 18 | public uint NumberOfLinks; 19 | public uint FileIndexHigh; 20 | public uint FileIndexLow; 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Win32/NativeMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Mathematics; 5 | 6 | namespace Vortice.Win32; 7 | 8 | [StructLayout(LayoutKind.Sequential)] 9 | public partial struct NativeMessage 10 | { 11 | //[NativeTypeName("HWND")] 12 | public nint hwnd; 13 | public uint msg; 14 | //[NativeTypeName("WPARAM")] 15 | public nuint wParam; 16 | //[NativeTypeName("LPARAM")] 17 | public nint lParam; 18 | public uint time; 19 | public Int2 pt; 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.DirectX/Win32/PointerInputType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Win32; 5 | 6 | /// 7 | /// Identifies the pointer input types. 8 | /// 9 | public enum PointerInputType 10 | { 11 | /// 12 | /// Generic pointer type 13 | /// 14 | Pointer = 1, 15 | 16 | /// 17 | /// Touch pointer type. 18 | /// 19 | Touch = 2, 20 | 21 | /// 22 | /// Pen pointer type. 23 | /// 24 | Pen = 3, 25 | 26 | /// 27 | /// Mouse pointer type. 28 | /// 29 | Mouse = 4, 30 | 31 | /// 32 | /// Touchpad pointer type (Windows 8.1 and later). 33 | /// 34 | Touchpad = 5, 35 | } 36 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/DxcShaderStage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public enum DxcShaderStage : uint 7 | { 8 | Vertex, 9 | Hull, 10 | Domain, 11 | Geometry, 12 | Pixel, 13 | Compute, 14 | Amplification, 15 | Mesh, 16 | Library, 17 | Count, 18 | } 19 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/DxcValidatorFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | [Flags] 7 | public enum DxcValidatorFlags : int 8 | { 9 | Default = 0, 10 | InPlaceEdit = 1, 11 | RootSignatureOnly = 2, 12 | ModuleOnly = 4, 13 | ValidMask = 0x7, 14 | } 15 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/DxcVersionInfoFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | [Flags] 7 | public enum DxcVersionInfoFlags : int 8 | { 9 | DxcVersionInfoFlags_None = 0, 10 | Debug = 1, 11 | Internal = 2 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcAssembler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcAssembler 7 | { 8 | public IDxcOperationResult AssembleToContainer(IDxcBlob shader) 9 | { 10 | AssembleToContainer(shader, out IDxcOperationResult result).CheckError(); 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcContainerBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcContainerBuilder 7 | { 8 | public IDxcOperationResult SerializeContainer(IDxcBlob source) 9 | { 10 | SerializeContainer(out IDxcOperationResult result).CheckError(); 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcOperationResult 7 | { 8 | public IDxcBlobEncoding GetErrorBuffer() 9 | { 10 | GetErrorBuffer(out IDxcBlobEncoding result).CheckError(); 11 | return result; 12 | } 13 | 14 | public IDxcBlob GetResult() 15 | { 16 | GetResult(out IDxcBlob result).CheckError(); 17 | return result; 18 | } 19 | 20 | public Result GetStatus() 21 | { 22 | GetStatus(out Result result).CheckError(); 23 | return result; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcPdbUtils.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcPdbUtils 7 | { 8 | public IDxcResult CompileForFullPDB() 9 | { 10 | CompileForFullPDB(out IDxcResult result).CheckError(); 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcValidator 7 | { 8 | public IDxcOperationResult Validate(IDxcBlob shader, DxcValidatorFlags flags) 9 | { 10 | Validate(shader, flags, out IDxcOperationResult result).CheckError(); 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/IDxcVersionInfo2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.Dxc; 5 | 6 | public partial class IDxcVersionInfo2 7 | { 8 | public unsafe Result GetCommitInfo(out uint commitCount, out string? commitHash) 9 | { 10 | Result result = GetCommitInfo(out commitCount, out nint commitHashPtr); 11 | commitHash = Marshal.PtrToStringUTF8(commitHashPtr); 12 | Marshal.FreeCoTaskMem(commitHashPtr); 13 | return result; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/Vortice.Dxc/Vortice.Dxc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | DirectXShaderCompiler (DXC) bindings 8 | Vortice.Dxc 9 | README.md 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/DeviceStates.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.MediaFoundation; 5 | 6 | [Flags] 7 | public enum DeviceStates 8 | { 9 | None = 0, 10 | Active = 0x00000001, 11 | Disabled = 0x00000002, 12 | NotPresent = 0x00000004, 13 | Unplugged = 0x00000008, 14 | All = 0x0000000f 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/IMFMediaEngineClassFactory2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.MediaFoundation; 5 | 6 | public partial class IMFMediaEngineClassFactory2 7 | { 8 | public IMFMediaKeys CreateMediaKeys2(string keySystem, string defaultCdmStorePath) 9 | { 10 | return CreateMediaKeys2(keySystem, defaultCdmStorePath, null); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/IMFMediaEngineClassFactoryEx.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.InteropServices; 5 | using SharpGen.Runtime; 6 | 7 | namespace Vortice.MediaFoundation; 8 | 9 | public partial class IMFMediaEngineClassFactoryEx 10 | { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/MediaAttributeKeys.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Multimedia; 5 | 6 | namespace Vortice.MediaFoundation; 7 | 8 | public partial class MediaAttributeKeys 9 | { 10 | public static readonly MediaAttributeKey UserDataPayload = new(UserDataPayloadGuid); 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/StorageAccessMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.MediaFoundation; 5 | 6 | /// 7 | /// MMDevice STGM enumeration 8 | /// 9 | public enum StorageAccessMode 10 | { 11 | /// 12 | /// Read-only access mode. 13 | /// 14 | Read, 15 | /// 16 | /// Write-only access mode. 17 | /// 18 | Write, 19 | /// 20 | /// Read-write access mode. 21 | /// 22 | ReadWrite 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.MediaFoundation/Vortice.MediaFoundation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Media Foundation bindings 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationManager 7 | { 8 | private static readonly Guid CLSID_UIAnimationManager = new("4C1FC63A-695C-47E8-A339-1A194BE3D0B8"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationManager() 14 | { 15 | ComUtilities.CreateComInstance(CLSID_UIAnimationManager, 16 | ComContext.InprocServer, 17 | typeof(IUIAnimationManager).GUID, 18 | this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationManager2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationManager2 7 | { 8 | private static readonly Guid CLSID_UIAnimationManager2 = new("D25D8842-8884-4A4A-B321-091314379BDD"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationManager2() 14 | { 15 | ComUtilities.CreateComInstance(CLSID_UIAnimationManager2, 16 | ComContext.InprocServer, 17 | typeof(IUIAnimationManager2).GUID, 18 | this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTimer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTimer 7 | { 8 | private static readonly Guid CLSID_UIAnimationTimer = new("BFCD4A0C-06B6-4384-B768-0DAA792C380E"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationTimer() 14 | { 15 | ComUtilities.CreateComInstance( 16 | CLSID_UIAnimationTimer, 17 | ComContext.InprocServer, 18 | typeof(IUIAnimationTimer).GUID, 19 | this); 20 | } 21 | 22 | /// 23 | /// Determines whether the timer is currently enabled. 24 | /// 25 | public bool IsEnabled => IsEnabled_().Success; 26 | } 27 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTransition2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTransition2 7 | { 8 | /// 9 | /// Determines whether the duration of a transition is known. 10 | /// 11 | public bool IsDurationKnown => IsDurationKnown_().Success; 12 | } 13 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTransitionFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTransitionFactory 7 | { 8 | private static readonly Guid CLSID_IUIAnimationTransitionFactory = new("8A9B1CDD-FCD7-419c-8B44-42FD17DB1887"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationTransitionFactory() 14 | { 15 | ComUtilities.CreateComInstance(CLSID_IUIAnimationTransitionFactory, 16 | ComContext.InprocServer, 17 | typeof(IUIAnimationTransitionFactory).GUID, 18 | this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTransitionFactory2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTransitionFactory2 7 | { 8 | private static readonly Guid CLSID_IUIAnimationTransitionFactory2 = new("84302F97-7F7B-4040-B190-72AC9D18E420"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationTransitionFactory2() 14 | { 15 | ComUtilities.CreateComInstance 16 | (CLSID_IUIAnimationTransitionFactory2, 17 | ComContext.InprocServer, 18 | typeof(IUIAnimationTransitionFactory2).GUID, 19 | this); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTransitionLibrary.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTransitionLibrary 7 | { 8 | private static readonly Guid CLSID_UIAnimationTransitionLibrary = new("1D6322AD-AA85-4EF5-A828-86D71067D145"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationTransitionLibrary() 14 | { 15 | ComUtilities.CreateComInstance(CLSID_UIAnimationTransitionLibrary, 16 | ComContext.InprocServer, 17 | typeof(IUIAnimationTransitionLibrary).GUID, 18 | this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationTransitionLibrary2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial class IUIAnimationTransitionLibrary2 7 | { 8 | private static readonly Guid CLSID_UIAnimationTransitionLibrary2 = new("812F944A-C5C8-4CD9-B0A6-B3DA802F228D"); 9 | 10 | /// 11 | /// Create a new instance of the class. 12 | /// 13 | public IUIAnimationTransitionLibrary2() 14 | { 15 | ComUtilities.CreateComInstance(CLSID_UIAnimationTransitionLibrary2, 16 | ComContext.InprocServer, 17 | typeof(IUIAnimationTransitionLibrary2).GUID, 18 | this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationVariableChangeHandler2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial interface IUIAnimationVariableChangeHandler2 7 | { 8 | void OnValueChanged(IUIAnimationStoryboard2 storyboard, IUIAnimationVariable2 variable, Span newValue, Span previousValue, uint dimension); 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/IUIAnimationVariableIntegerChangeHandler2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.UIAnimation; 5 | 6 | public partial interface IUIAnimationVariableIntegerChangeHandler2 7 | { 8 | void OnValueChanged(IUIAnimationStoryboard2 storyboard, IUIAnimationVariable2 variable, Span newValue, Span previousValue, uint dimension); 9 | } 10 | -------------------------------------------------------------------------------- /src/Vortice.UIAnimation/Vortice.UIAnimation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Windows Animation Manager bindings. 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Vortice.WinForms/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: DisableRuntimeMarshalling] 7 | -------------------------------------------------------------------------------- /src/Vortice.WinForms/Vortice.WinForms.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0-windows;net9.0-windows 5 | Vortice.WinForms 6 | Direct3D11 WinForms integration 7 | true 8 | $(NoWarn);WFO1000 9 | README.md 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Vortice.WinForms/Win32Native.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using SharpGen.Runtime; 5 | using Vortice.Win32; 6 | 7 | namespace Vortice.WinForms; 8 | 9 | internal unsafe static partial class Win32Native 10 | { 11 | [LibraryImport("user32")] 12 | public static partial RawBool PeekMessageW(NativeMessage* lpMsg, nint hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg); 13 | 14 | [LibraryImport("user32")] 15 | public static partial int GetMessageW(NativeMessage* lpMsg, nint hWnd, uint wMsgFilterMin, uint wMsgFilterMax); 16 | 17 | [LibraryImport("user32")] 18 | public static partial RawBool TranslateMessage(NativeMessage* lpMsg); 19 | 20 | [LibraryImport("user32")] 21 | public static partial /*LRESULT*/nint DispatchMessageW(NativeMessage* lpMsg); 22 | 23 | [LibraryImport("user32")] 24 | public static partial RawBool GetClientRect(nint hWnd, RawRect* lpRect); 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.WinUI/Composition/IVisualInteractionSourceInterop.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Win32; 5 | 6 | namespace Vortice.WinUI.Composition; 7 | 8 | [Guid("AA170AEE-01D7-4954-89D2-8554415D6946")] 9 | public partial class IVisualInteractionSourceInterop : ComObject 10 | { 11 | public IVisualInteractionSourceInterop(IntPtr nativePtr) : base(nativePtr) 12 | { 13 | } 14 | 15 | public static explicit operator IVisualInteractionSourceInterop?(IntPtr nativePtr) => nativePtr == IntPtr.Zero ? null : new IVisualInteractionSourceInterop(nativePtr); 16 | 17 | public unsafe Result TryRedirectForManipulation(ref PointerInfo pointerInfo) 18 | { 19 | return ((delegate* unmanaged)this[3])(NativePointer, ref pointerInfo); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.WinUI/ISurfaceImageSourceManagerNative.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.WinUI; 5 | 6 | [Guid("81521d7e-ff74-4a6b-8289-44bfd11cf0cc")] 7 | public partial class ISurfaceImageSourceManagerNative : ComObject 8 | { 9 | public ISurfaceImageSourceManagerNative(IntPtr nativePtr) : base(nativePtr) 10 | { 11 | } 12 | 13 | public static explicit operator ISurfaceImageSourceManagerNative?(IntPtr nativePtr) => nativePtr == IntPtr.Zero ? null : new ISurfaceImageSourceManagerNative(nativePtr); 14 | 15 | public unsafe Result FlushAllSurfacesWithDevice(IUnknown device) 16 | { 17 | IntPtr device_ = MarshallingHelpers.ToCallbackPtr(device); 18 | Result result = ((delegate* unmanaged)this[3])(NativePointer, (void*)device_); 19 | GC.KeepAlive(device); 20 | return result; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Vortice.WinUI/WinUIHelpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | #if WINDOWS 5 | using WinRT; 6 | 7 | namespace Vortice.WinUI; 8 | 9 | internal static class WinUIHelpers 10 | { 11 | public static nint GetNativeObject(Guid guid, object obj) 12 | { 13 | Result result = ((IWinRTObject)obj).NativeObject.TryAs(guid, out nint handle); 14 | result.CheckError(); 15 | return handle; 16 | } 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Vortice.Wpf/DrawEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using Vortice.Direct3D11; 5 | 6 | namespace Vortice.Wpf; 7 | 8 | /// 9 | /// Provides data for the Draw event. 10 | /// 11 | public class DrawEventArgs : DrawingSurfaceEventArgs 12 | { 13 | public DrawEventArgs(DrawingSurface surface, ID3D11Device1 device, ID3D11DeviceContext1 context) 14 | : base(device, context) 15 | { 16 | ArgumentNullException.ThrowIfNull(nameof(surface)); 17 | 18 | Surface = surface; 19 | } 20 | 21 | public DrawingSurface Surface { get; } 22 | 23 | public void InvalidateSurface() 24 | { 25 | Surface.Invalidate(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Vortice.Wpf/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Markup; 3 | 4 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] 5 | 6 | [assembly: XmlnsDefinition("http://schemas.vortice.windows.io", "Vortice.Wpf")] 7 | -------------------------------------------------------------------------------- /src/Vortice.Wpf/Vortice.Wpf.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0-windows;net9.0-windows 5 | Vortice.Wpf 6 | WPF integration 7 | true 8 | README.md 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Vortice.XAudio2/DistanceCurve.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.CompilerServices; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Vortice.XAudio2; 8 | 9 | internal unsafe partial struct DistanceCurve 10 | { 11 | public static IntPtr FromCurvePoints(Span points) 12 | { 13 | if (points == null || points.Length == 0) 14 | return IntPtr.Zero; 15 | 16 | var pDistanceCurve = (DistanceCurve*)Marshal.AllocHGlobal(Unsafe.SizeOf() + points.Length * Unsafe.SizeOf()); 17 | var pPoints = (CurvePoint*)&pDistanceCurve[1]; 18 | pDistanceCurve->PointCount = (uint)points.Length; 19 | pDistanceCurve->PointsPointer = new IntPtr(pPoints); 20 | MemoryHelpers.Write(pDistanceCurve->PointsPointer, points, points.Length); 21 | return (IntPtr)pDistanceCurve; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Vortice.XAudio2/ErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XAudio2; 5 | 6 | /// 7 | /// EventArgs used by . 8 | /// 9 | public class ErrorEventArgs : EventArgs 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The error code. 15 | public ErrorEventArgs(Result errorCode) 16 | { 17 | ErrorCode = errorCode; 18 | } 19 | 20 | /// 21 | /// Gets the error code. 22 | /// 23 | public Result ErrorCode { get; } 24 | } 25 | -------------------------------------------------------------------------------- /src/Vortice.XAudio2/Fx/VolumeMeterLevels.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.XAudio2/Fx/VolumeMeterLevels.cs -------------------------------------------------------------------------------- /src/Vortice.XAudio2/SubmixVoiceFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XAudio2; 5 | 6 | [Flags] 7 | public enum SubmixVoiceFlags 8 | { 9 | None = VoiceFlags.None, 10 | UseFilter = VoiceFlags.UseFilter 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.XAudio2/Vortice.XAudio2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | net8.0;net9.0 7 | Vortice.XAudio2 8 | XAudio2 and X3DAudio bindings 9 | README.md 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Vortice.XAudio2/X3DAudioHandle.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | using System.Runtime.InteropServices; 5 | 6 | namespace Vortice.XAudio2; 7 | 8 | [StructLayout(LayoutKind.Explicit, Size = 20)] 9 | internal struct X3DAudioHandle 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.XInput/BatteryDeviceType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | /// 7 | /// Retrieves the battery type and charge status of a wireless controller. 8 | /// 9 | public enum BatteryDeviceType 10 | { 11 | /// 12 | /// Index of the signed-in gamer associated with the device. 13 | /// Can be a value in the range 0-4 ? 1. 14 | /// 15 | Gamepad, 16 | /// 17 | /// Specifies which device associated with this user index should be queried. Must be BATTERY_DEVTYPE_GAMEPAD or BATTERY_DEVTYPE_HEADSET. 18 | /// 19 | Headset 20 | } 21 | -------------------------------------------------------------------------------- /src/Vortice.XInput/BatteryInformation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | /// 7 | /// Contains information on battery type and charge state. 8 | /// 9 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 10 | public readonly struct BatteryInformation 11 | { 12 | /// 13 | /// The type of battery. 14 | /// 15 | public readonly BatteryType BatteryType; 16 | 17 | /// 18 | /// The charge state of the battery. 19 | /// 20 | public readonly BatteryLevel BatteryLevel; 21 | } 22 | -------------------------------------------------------------------------------- /src/Vortice.XInput/BatteryLevel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | /// 7 | /// Describes The charge state of the battery. 8 | /// 9 | public enum BatteryLevel : byte 10 | { 11 | Empty, 12 | Low, 13 | Medium, 14 | Full 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.XInput/BatteryType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | /// 7 | /// Describes the battery type. 8 | /// 9 | public enum BatteryType : byte 10 | { 11 | /// 12 | /// The device is not connected. 13 | /// 14 | Disconnected = 0, 15 | /// 16 | /// The device is a wired device and does not have a battery. 17 | /// 18 | Wired = 1, 19 | /// 20 | /// The device has an alkaline battery. 21 | /// 22 | Alkaline = 2, 23 | /// 24 | /// The device has a nickel metal hydride battery. 25 | /// 26 | Nimh = 3, 27 | /// 28 | /// The device has an unknown battery type. 29 | /// 30 | Unknown = byte.MaxValue 31 | } 32 | -------------------------------------------------------------------------------- /src/Vortice.XInput/DeviceQueryType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | public enum DeviceQueryType 7 | { 8 | Any = 0, 9 | Gamepad = 1 10 | } 11 | -------------------------------------------------------------------------------- /src/Vortice.XInput/DeviceType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | /// 7 | /// Describes Device types available in . 8 | /// 9 | public enum DeviceType : byte 10 | { 11 | /// 12 | /// The device is a game controller. 13 | /// 14 | Gamepad = 0x01 15 | } 16 | -------------------------------------------------------------------------------- /src/Vortice.XInput/GamepadButtons.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | [Flags] 7 | public enum GamepadButtons : ushort 8 | { 9 | None = 0, 10 | DPadUp = 0x0001, 11 | DPadDown = 0x0002, 12 | DPadLeft = 0x0004, 13 | DPadRight = 0x0008, 14 | Start = 0x0010, 15 | Back = 0x0020, 16 | LeftThumb = 0x0040, 17 | RightThumb = 0x0080, 18 | LeftShoulder = 0x0100, 19 | RightShoulder = 0x0200, 20 | Guide = 0x0400, 21 | A = 0x1000, 22 | B = 0x2000, 23 | X = 0x4000, 24 | Y = 0x8000 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.XInput/KeyStrokeFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | [Flags] 7 | public enum KeyStrokeFlags : ushort 8 | { 9 | /// 10 | /// None. 11 | /// 12 | None = 0, 13 | /// 14 | /// The key was pressed. 15 | /// 16 | KeyDown = 0x0001, 17 | /// 18 | /// The key was released. 19 | /// 20 | KeyUp = 0x0002, 21 | /// 22 | /// A repeat of a held key. 23 | /// 24 | Repeat = 0x0004, 25 | } 26 | -------------------------------------------------------------------------------- /src/Vortice.XInput/Keystroke.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerkoleci/Vortice.Windows/492a77ab0f509f4659d7db211a7494e7b13ddee8/src/Vortice.XInput/Keystroke.cs -------------------------------------------------------------------------------- /src/Vortice.XInput/Vibration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Amer Koleci and Contributors. 2 | // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. 3 | 4 | namespace Vortice.XInput; 5 | 6 | [StructLayout(LayoutKind.Sequential)] 7 | public readonly struct Vibration(ushort leftMotorSpeed, ushort rightMotorSpeed) 8 | { 9 | public readonly ushort LeftMotorSpeed = leftMotorSpeed; 10 | public readonly ushort RightMotorSpeed = rightMotorSpeed; 11 | } 12 | -------------------------------------------------------------------------------- /src/Vortice.XInput/Vortice.XInput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0;net9.0 5 | Vortice.XInput 6 | XInput bindings 7 | README.md 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/native/include/WinUI/dwrite_core.h: -------------------------------------------------------------------------------- 1 | #define DWRITE_CORE 1 2 | #include "dwrite_3.h" 3 | 4 | /// 5 | /// Creates a factory object that is used for subsequent creation of individual DWriteCore objects. 6 | /// 7 | /// Identifies whether the factory object will be shared or isolated. 8 | /// Identifies the DirectWrite factory interface, such as UUIDOF(IDWriteFactory). 9 | /// Receives the DirectWrite factory object. 10 | /// 11 | /// Standard HRESULT error code. 12 | /// 13 | /// 14 | /// This is functionally the same as the DWriteCreateFactory function exported by the system version 15 | /// of DirectWrite. The DWriteCore function has a different name to avoid ambiguity. 16 | /// 17 | EXTERN_C HRESULT DWRITE_EXPORT DWriteCoreCreateFactory( 18 | _In_ DWRITE_FACTORY_TYPE factoryType, 19 | _In_ REFIID iid, 20 | _COM_Outptr_ IUnknown** factory 21 | ); 22 | -------------------------------------------------------------------------------- /src/native/include/WinUI/winrt/Microsoft.UI.Input.InputCursor.Interop.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | //--------------------------------------------------------------------------- 4 | 5 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 6 | #pragma once 7 | #endif 8 | 9 | #include 10 | 11 | namespace winrt { 12 | namespace Microsoft { 13 | namespace UI { 14 | namespace Input { 15 | 16 | #undef INTERFACE 17 | #define INTERFACE IInputCursorStaticsInterop 18 | 19 | DECLARE_INTERFACE_IID_(IInputCursorStaticsInterop, IInspectable, "ac6f5065-90c4-46ce-beb7-05e138e54117") 20 | { 21 | IFACEMETHOD(CreateFromHCursor)( 22 | _In_ HCURSOR cursor, 23 | _Out_ IInputCursor * *result 24 | ) PURE; 25 | }; 26 | 27 | } // namespace Input 28 | } // namespace UI 29 | } // namespace Microsoft 30 | } // namespace winrt -------------------------------------------------------------------------------- /tests/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/Vortice.D3DCompiler.Test/Assets/Common.hlsli: -------------------------------------------------------------------------------- 1 | struct VSInput { 2 | float4 Position : POSITION; 3 | float4 Color : COLOR; 4 | }; 5 | 6 | struct PSInput { 7 | float4 Position : SV_POSITION; 8 | float4 Color : COLOR; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/Vortice.D3DCompiler.Test/Assets/Triangle.hlsl: -------------------------------------------------------------------------------- 1 | #include "Common.hlsli" 2 | 3 | PSInput VSMain(VSInput input) { 4 | PSInput result; 5 | result.Position = input.Position; 6 | result.Color = input.Color; 7 | return result; 8 | } 9 | 10 | float4 PSMain(PSInput input) : SV_TARGET{ 11 | return input.Color; 12 | } 13 | -------------------------------------------------------------------------------- /tests/Vortice.D3DCompiler.Test/Assets/TriangleError.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput 2 | { 3 | float4 Position : POSITION; 4 | float4 Color : COLOR; 5 | }; 6 | 7 | struct PSInput 8 | { 9 | float4 Position : SV_POSITION; 10 | float4 Color : COLOR; 11 | }; 12 | 13 | 14 | PSInput VSMain(VSInput input) 15 | { 16 | PSInput result; 17 | result.ThisIsAnError = input.Position; 18 | result.Color = input.Color; 19 | return result; 20 | } 21 | 22 | float4 PSMain(PSInput input) : SV_TARGET 23 | { 24 | return input.Color; 25 | } 26 | -------------------------------------------------------------------------------- /tests/Vortice.D3DCompiler.Test/Assets/TriangleSingleFile.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput 2 | { 3 | float4 Position : POSITION; 4 | float4 Color : COLOR; 5 | }; 6 | 7 | struct PSInput 8 | { 9 | float4 Position : SV_POSITION; 10 | float4 Color : COLOR; 11 | }; 12 | 13 | 14 | PSInput VSMain(VSInput input) { 15 | PSInput result; 16 | result.Position = input.Position; 17 | result.Color = input.Color; 18 | return result; 19 | } 20 | 21 | float4 PSMain(PSInput input) : SV_TARGET{ 22 | return input.Color; 23 | } 24 | -------------------------------------------------------------------------------- /tests/Vortice.D3DCompiler.Test/Vortice.D3DCompiler.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0;net9.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/Vortice.DXGI.Tests/Vortice.DXGI.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0;net9.0 5 | false 6 | 7 | 8 | 9 | 10 | PreserveNewest 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/Vortice.Dxc.Test/Assets/Common.hlsli: -------------------------------------------------------------------------------- 1 | struct VSInput { 2 | float4 Position : POSITION; 3 | float4 Color : COLOR; 4 | }; 5 | 6 | struct PSInput { 7 | float4 Position : SV_POSITION; 8 | float4 Color : COLOR; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/Vortice.Dxc.Test/Assets/Triangle.hlsl: -------------------------------------------------------------------------------- 1 | #include "Common.hlsli" 2 | 3 | PSInput VSMain(VSInput input) { 4 | PSInput result; 5 | result.Position = input.Position; 6 | result.Color = input.Color; 7 | return result; 8 | } 9 | 10 | float4 PSMain(PSInput input) : SV_TARGET{ 11 | return input.Color; 12 | } 13 | -------------------------------------------------------------------------------- /tests/Vortice.Dxc.Test/Assets/TriangleError.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput 2 | { 3 | float4 Position : POSITION; 4 | float4 Color : COLOR; 5 | }; 6 | 7 | struct PSInput 8 | { 9 | float4 Position : SV_POSITION; 10 | float4 Color : COLOR; 11 | }; 12 | 13 | 14 | PSInput VSMain(VSInput input) 15 | { 16 | PSInput result; 17 | result.ThisIsAnError = input.Position; 18 | result.Color = input.Color; 19 | return result; 20 | } 21 | 22 | float4 PSMain(PSInput input) : SV_TARGET 23 | { 24 | return input.Color; 25 | } 26 | -------------------------------------------------------------------------------- /tests/Vortice.Dxc.Test/Assets/TriangleSingleFile.hlsl: -------------------------------------------------------------------------------- 1 | struct VSInput 2 | { 3 | float4 Position : POSITION; 4 | float4 Color : COLOR; 5 | }; 6 | 7 | struct PSInput 8 | { 9 | float4 Position : SV_POSITION; 10 | float4 Color : COLOR; 11 | }; 12 | 13 | 14 | PSInput VSMain(VSInput input) { 15 | PSInput result; 16 | result.Position = input.Position; 17 | result.Color = input.Color; 18 | return result; 19 | } 20 | 21 | float4 PSMain(PSInput input) : SV_TARGET{ 22 | return input.Color; 23 | } 24 | -------------------------------------------------------------------------------- /tests/Vortice.Dxc.Test/Vortice.Dxc.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0;net9.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | 19 | --------------------------------------------------------------------------------