├── .gitignore ├── DirectX ├── BeefProj.toml └── src │ ├── Color.bf │ ├── ColorRGB.bf │ ├── ColorRGBA.bf │ ├── Common │ ├── BigBool.bf │ ├── Common.bf │ ├── D3DCBufferType.bf │ ├── D3DName.bf │ ├── D3DRegisterComponentType.bf │ ├── D3DShaderCBufferFlags.bf │ ├── D3DShaderVariableFlags.bf │ ├── DriverType.bf │ ├── FeatureLevel.bf │ ├── HResult.bf │ ├── ID3DBlob.bf │ ├── ID3DInclude.bf │ ├── IUnknown.bf │ ├── IncludeType.bf │ ├── InterpolationMode.bf │ ├── LargerInteger.bf │ ├── Luid.bf │ ├── MinPrecision.bf │ ├── ParameterFlags.bf │ ├── Primitive.bf │ ├── PrimitiveTopology.bf │ ├── ResourceReturnType.bf │ ├── ShaderInputFlags.bf │ ├── ShaderInputType.bf │ ├── ShaderMacro.bf │ ├── ShaderResourceViewDimension.bf │ ├── ShaderVariableClass.bf │ ├── ShaderVariableType.bf │ ├── TessellatorDomain.bf │ ├── TessellatorOutputPrimitive.bf │ └── TessellatorPartitioning.bf │ ├── CorelibExtensions │ └── GuidExtension.bf │ ├── D3D11 │ ├── AsyncGetDataFlags.bf │ ├── BindFlags.bf │ ├── Blend.bf │ ├── BlendDescription.bf │ ├── BlendOperation.bf │ ├── Box.bf │ ├── BufferDescription.bf │ ├── BufferExShaderResourceViewFlags.bf │ ├── BufferUavFlags.bf │ ├── CPUAccessFlags.bf │ ├── ClassInstanceDescription.bf │ ├── ClearFlags.bf │ ├── ColorWriteEnable.bf │ ├── ComparisonFunction.bf │ ├── ConservativeRasterizationTier.bf │ ├── Constants.bf │ ├── Counter.bf │ ├── CounterDescription.bf │ ├── CounterInfo.bf │ ├── CounterType.bf │ ├── CullMode.bf │ ├── D3D11.bf │ ├── DepthStencilOperationDescription.bf │ ├── DepthStencilStateDescription.bf │ ├── DepthStencilViewDescription.bf │ ├── DepthStencilViewDimension.bf │ ├── DepthStencilViewFlags.bf │ ├── DepthStencilViews.bf │ ├── DepthWriteMask.bf │ ├── DeviceContextStages │ │ ├── ComputeShaderStage.bf │ │ ├── DomainShaderStage.bf │ │ ├── GeometryShaderStage.bf │ │ ├── HullShaderStage.bf │ │ ├── InputAssemblerStage.bf │ │ ├── OutputMergerStage.bf │ │ ├── PixelShaderStage.bf │ │ ├── RasterizerStage.bf │ │ ├── StreamOutputStage.bf │ │ └── VertexShaderStage.bf │ ├── DeviceContextType.bf │ ├── DeviceCreationFlags.bf │ ├── DrawIndexedInstancedIndirectArgs.bf │ ├── DrawInstancedIndirectArgs.bf │ ├── Feature.bf │ ├── FillMode.bf │ ├── Filter.bf │ ├── FormatSupport.bf │ ├── FormatSupport2.bf │ ├── ID3D11Asynchronous.bf │ ├── ID3D11AuthenticatedChannel.bf │ ├── ID3D11BlendState.bf │ ├── ID3D11Buffer.bf │ ├── ID3D11ClassInstance.bf │ ├── ID3D11ClassLinkage.bf │ ├── ID3D11CommandList.bf │ ├── ID3D11ComputeShader.bf │ ├── ID3D11Counter.bf │ ├── ID3D11CryptoSession.bf │ ├── ID3D11DepthStencilState.bf │ ├── ID3D11DepthStencilView.bf │ ├── ID3D11Device.bf │ ├── ID3D11DeviceChild.bf │ ├── ID3D11DeviceContext.bf │ ├── ID3D11DomainShader.bf │ ├── ID3D11GeometryShader.bf │ ├── ID3D11HullShader.bf │ ├── ID3D11InputLayout.bf │ ├── ID3D11PixelShader.bf │ ├── ID3D11Predicate.bf │ ├── ID3D11Query.bf │ ├── ID3D11RasterizerState.bf │ ├── ID3D11RenderTargetView.bf │ ├── ID3D11Resource.bf │ ├── ID3D11SamplerState.bf │ ├── ID3D11ShaderResourceView.bf │ ├── ID3D11Texture1D.bf │ ├── ID3D11Texture2D.bf │ ├── ID3D11Texture3D.bf │ ├── ID3D11UnorderedAccessView.bf │ ├── ID3D11VertexShader.bf │ ├── ID3D11View.bf │ ├── InputClassification.bf │ ├── InputElementDescription.bf │ ├── MapFlags.bf │ ├── MapType.bf │ ├── MappedSubresource.bf │ ├── Query.bf │ ├── QueryDataTimestampDisjoint.bf │ ├── QueryDescription.bf │ ├── QueryMiscFlags.bf │ ├── RaiseFlags.bf │ ├── RasterizerStateDescription.bf │ ├── RenderTargetBlendDescription.bf │ ├── RenderTargetViewDescription.bf │ ├── RenderTargetViewDimension.bf │ ├── RenderTargetViews.bf │ ├── ResourceDimension.bf │ ├── ResourceMiscFlag.bf │ ├── SDKLayers │ │ ├── FeatureMaskFlags.bf │ │ ├── ID3D11Debug.bf │ │ ├── ID3D11InfoQueue.bf │ │ ├── InfoQueueFilter.bf │ │ ├── InfoQueueFilterDescription.bf │ │ ├── Message.bf │ │ ├── MessageCategory.bf │ │ ├── MessageID.bf │ │ ├── MessageSeverity.bf │ │ └── ReportLiveDeviceObjectFlags.bf │ ├── SamplerStateDescription.bf │ ├── ShaderMinimumPrecision.bf │ ├── ShaderResourceViewDescription.bf │ ├── ShaderResourceViews.bf │ ├── SharedResourceTier.bf │ ├── StencilOperation.bf │ ├── StreamOutputDeclarationEntry.bf │ ├── SubresourceData.bf │ ├── Texture1DDescription.bf │ ├── Texture2DDescription.bf │ ├── Texture3DDescription.bf │ ├── TextureAddressMode.bf │ ├── TextureCubeFace.bf │ ├── TiledResourceTier.bf │ ├── UnorderedAccessViewDescription.bf │ ├── UnorderedAccessViewDimension.bf │ ├── UnorderedAccessViews.bf │ ├── Usage.bf │ └── Viewport.bf │ ├── D3D11Shader │ ├── D3D11Shader.bf │ ├── FunctionDescription.bf │ ├── ID3D11FunctionLinkingGraph.bf │ ├── ID3D11FunctionParameterReflection.bf │ ├── ID3D11FunctionReflection.bf │ ├── ID3D11LibraryReflection.bf │ ├── ID3D11Linker.bf │ ├── ID3D11LinkingNode.bf │ ├── ID3D11Module.bf │ ├── ID3D11ModuleInstance.bf │ ├── ID3D11ShaderReflection.bf │ ├── ID3D11ShaderReflectionConstantBuffer.bf │ ├── ID3D11ShaderReflectionType.bf │ ├── ID3D11ShaderReflectionVariable.bf │ ├── LibraryDescription.bf │ ├── ParameterDescription.bf │ ├── ShaderBufferDescription.bf │ ├── ShaderDescription.bf │ ├── ShaderInputBindDescription.bf │ ├── ShaderTypeDescription.bf │ ├── ShaderVariableDescription.bf │ ├── ShaderVersionType.bf │ └── SignatureParameterDescription.bf │ ├── D3DCompiler │ ├── BlobPartFlags.bf │ ├── CompressShaderFlags.bf │ ├── D3DCompiler.bf │ ├── D3DShaderData.bf │ ├── DecompressShaderFlags.bf │ ├── DisassembleFlags.bf │ ├── EffectCompileFlags.bf │ ├── GetTraceInstructionOffsetFlags.bf │ ├── SecondaryDataFlags.bf │ ├── ShaderCompileFlags.bf │ └── StripFlags.bf │ ├── DXGI │ ├── AdapterDescription.bf │ ├── AdapterDescription1.bf │ ├── AdapterFlags.bf │ ├── DXGI.bf │ ├── DXGI1_2 │ │ ├── AdapterDescription2.bf │ │ ├── AlphaMode.bf │ │ ├── ComputePreemtionGranularity.bf │ │ ├── DXGI1_2.bf │ │ ├── GraphicsPreemtionGranularity.bf │ │ ├── IDXGIAdapter2.bf │ │ ├── IDXGIDevice2.bf │ │ ├── IDXGIDisplayControl.bf │ │ ├── IDXGIFactory2.bf │ │ ├── IDXGIOutput1.bf │ │ ├── IDXGIOutputDuplication.bf │ │ ├── IDXGIResource1.bf │ │ ├── IDXGISurface2.bf │ │ ├── IDXGISwapChain1.bf │ │ ├── ModeDescription1.bf │ │ ├── OfferResourcePriority.bf │ │ ├── PresentParameters.bf │ │ ├── ResourceAccessRight.bf │ │ ├── Scaling.bf │ │ ├── SwapChainDescription1.bf │ │ └── SwapChainFullscreenDescription.bf │ ├── EnumerationModes.bf │ ├── Format.bf │ ├── FrameStatistics.bf │ ├── GammaControl.bf │ ├── GammaControlCapabilities.bf │ ├── IDXGIAdapter.bf │ ├── IDXGIAdapter1.bf │ ├── IDXGIDevice.bf │ ├── IDXGIDevice1.bf │ ├── IDXGIDeviceSubObject.bf │ ├── IDXGIFactory.bf │ ├── IDXGIFactory1.bf │ ├── IDXGIKeyedMutex.bf │ ├── IDXGIObject.bf │ ├── IDXGIOutput.bf │ ├── IDXGIResource.bf │ ├── IDXGISurface.bf │ ├── IDXGISurface1.bf │ ├── IDXGISwapChain.bf │ ├── MapFlags.bf │ ├── MappedRectangle.bf │ ├── ModeDescription.bf │ ├── ModeRotation.bf │ ├── OutputDescription.bf │ ├── PresentFlags.bf │ ├── Rational.bf │ ├── Residency.bf │ ├── ResourcePriority.bf │ ├── SampleDescription.bf │ ├── Scaling.bf │ ├── ScanlineOrder.bf │ ├── SharedResource.bf │ ├── SurfaceDescription.bf │ ├── SwapChainDescription.bf │ ├── SwapChainFlag.bf │ ├── SwapEffect.bf │ ├── Usage.bf │ └── WindowAssociationFlags.bf │ ├── DirectX.bf │ ├── Math │ ├── MathUtil.bf │ ├── Matrix.bf │ ├── Matrix3x3.bf │ ├── Matrix4x3.bf │ ├── Point.bf │ ├── Rectangle.bf │ ├── Vector2.bf │ ├── Vector3.bf │ └── Vector4.bf │ ├── Windows │ ├── Gdi32 │ │ └── Gdi32.bf │ ├── Kernel32 │ │ └── Kernel32.bf │ ├── SecurityAttributes.bf │ ├── Windows.bf │ └── Winuser │ │ ├── ExtendedWindowStyle.bf │ │ ├── ExtendedWindowStyles.bf │ │ ├── HandleMessageFlags.bf │ │ ├── ImageLoadFlags.bf │ │ ├── ImageType.bf │ │ ├── Message.bf │ │ ├── MessageBoxButtons.bf │ │ ├── MessageBoxDefaultButton.bf │ │ ├── MessageBoxIcon.bf │ │ ├── MessageBoxModality.bf │ │ ├── MessageBoxOptions.bf │ │ ├── MessageBoxResult.bf │ │ ├── MinMaxInfo.bf │ │ ├── Mouse.bf │ │ ├── RAWINPUTDEVICE.bf │ │ ├── RAWINPUTHEADER.bf │ │ ├── RawInput.bf │ │ ├── ResizingType.bf │ │ ├── SystemColor.bf │ │ ├── VirtualKeyCodes.bf │ │ ├── WindowClassExW.bf │ │ ├── WindowClassStyles.bf │ │ ├── WindowClassW.bf │ │ ├── WindowMessages.bf │ │ ├── WindowStyles.bf │ │ └── Winuser.bf │ └── XAudio2 │ ├── Buffer.bf │ ├── BufferWMA.bf │ ├── DebugConfiguration.bf │ ├── EffectChain.bf │ ├── EffectDescriptor.bf │ ├── Enumerations.bf │ ├── ErrorCodes.bf │ ├── FilterParameters.bf │ ├── FilterType.bf │ ├── IXAudio2.bf │ ├── IXAudio2EngineCallback.bf │ ├── IXAudio2MasteringVoice.bf │ ├── IXAudio2SourceVoice.bf │ ├── IXAudio2SubmixVoice.bf │ ├── IXAudio2Voice.bf │ ├── IXAudio2VoiceCallback.bf │ ├── PerformaceData.bf │ ├── Processor.bf │ ├── VoiceDetails.bf │ ├── VoiceSendList.bf │ ├── WavHelper.bf │ └── XAudio2.bf ├── Examples ├── D3D11 │ └── SimpleTriangleExample │ │ ├── BeefProj.toml │ │ ├── BeefSpace.toml │ │ ├── content │ │ ├── basicShader.hlsl │ │ └── directx.ico │ │ └── src │ │ ├── ErrorPrinter.bf │ │ ├── Game.bf │ │ ├── GameTime.bf │ │ ├── Program.bf │ │ ├── VertexColor.bf │ │ └── Window.bf └── XAudio2 │ ├── CallbackExample │ ├── BeefProj.toml │ ├── BeefSpace.toml │ ├── content │ │ └── testSound.wav │ └── src │ │ └── Program.bf │ └── SimpleAudioPlayback │ ├── BeefProj.toml │ ├── BeefSpace.toml │ ├── content │ └── testSound.wav │ └── src │ └── Program.bf └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | BeefSpace_User.toml 2 | 3 | build/ 4 | recovery/ -------------------------------------------------------------------------------- /DirectX/BeefProj.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Dependencies = {corlib = "*"} 3 | 4 | [Project] 5 | Name = "DirectX" 6 | TargetType = "BeefLib" 7 | StartupObject = "Program" 8 | -------------------------------------------------------------------------------- /DirectX/src/ColorRGB.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX 4 | { 5 | /** 6 | * Represents an RGB color. 7 | */ 8 | [CRepr] 9 | public struct ColorRGB 10 | { 11 | /** 12 | * A value representing the color of the red component. 13 | * The range of this value is between 0 and 1. 14 | */ 15 | public float Red; 16 | /** 17 | * A value representing the color of the green component. 18 | * The range of this value is between 0 and 1. 19 | */ 20 | public float Green; 21 | /** 22 | * A value representing the color of the blue component. 23 | * The range of this value is between 0 and 1. 24 | */ 25 | public float Blue; 26 | 27 | public this() 28 | { 29 | this = default; 30 | } 31 | 32 | public this(float red, float green, float blue) 33 | { 34 | Red = red; 35 | Green = green; 36 | Blue = blue; 37 | } 38 | 39 | public this(ColorRGBA color) 40 | { 41 | Red = color.R; 42 | Green = color.G; 43 | Blue = color.B; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DirectX/src/Common/BigBool.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | A boolean-value with a size of 32 bits 5 | */ 6 | public enum BigBool : int32 7 | { 8 | case TRUE = 1; 9 | case FALSE = 0; 10 | 11 | public static implicit operator bool(BigBool b) 12 | { 13 | return b != FALSE; 14 | } 15 | 16 | public static implicit operator BigBool(bool b) 17 | { 18 | return b ? TRUE : FALSE; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DirectX/src/Common/Common.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | static 6 | { 7 | public static readonly Guid WKPDID_D3DDebugObjectName = .(0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00); 8 | public static readonly Guid WKPDID_D3DDebugObjectNameW = .(0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41); 9 | public static readonly Guid WKPDID_CommentStringW = .(0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2); 10 | 11 | /** @brief Releases the reference of the given Com-Object and sets the pointer to null. 12 | * @param val The com object-pointer to release and nullify. 13 | */ 14 | public static mixin ReleaseAndNullify(T* val) where T: IUnknown 15 | { 16 | ((IUnknown*)val)?.Release(); 17 | val = null; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/Common/D3DCBufferType.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | /** 6 | * D3D_CBUFFER_TYPE 7 | */ 8 | // Todo: 9 | [AllowDuplicates] 10 | public enum D3DCBufferType : uint32 11 | { 12 | D3D_CT_CBUFFER = 0, 13 | D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) , 14 | D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) , 15 | D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) , 16 | D3D10_CT_CBUFFER = D3D_CT_CBUFFER, 17 | D3D10_CT_TBUFFER = D3D_CT_TBUFFER, 18 | D3D11_CT_CBUFFER = D3D_CT_CBUFFER, 19 | D3D11_CT_TBUFFER = D3D_CT_TBUFFER, 20 | D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS, 21 | D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DirectX/src/Common/D3DRegisterComponentType.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | /** 6 | * Values that identify the data types that can be stored in a register. 7 | */ 8 | // Todo: 9 | [AllowDuplicates] 10 | public enum D3DRegisterComponentType : uint32 11 | { 12 | D3D_REGISTER_COMPONENT_UNKNOWN = 0, 13 | D3D_REGISTER_COMPONENT_UINT32 = 1, 14 | D3D_REGISTER_COMPONENT_SINT32 = 2, 15 | D3D_REGISTER_COMPONENT_FLOAT32 = 3, 16 | D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, 17 | D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, 18 | D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, 19 | D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DirectX/src/Common/D3DShaderCBufferFlags.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | /** 6 | * D3D_SHADER_CBUFFER_FLAGS 7 | */ 8 | //Todo: 9 | [AllowDuplicates] 10 | public enum D3DShaderCBufferFlags : uint32 11 | { 12 | D3D_CBF_USERPACKED = 1, 13 | D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED, 14 | D3D_CBF_FORCE_DWORD = 0x7fffffff 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DirectX/src/Common/D3DShaderVariableFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Values that identify information about a shader variable. 5 | * D3D_SHADER_VARIABLE_FLAGS 6 | */ 7 | public enum D3DShaderVariableFlags : uint32 8 | { 9 | /** 10 | * Indicates that the registers assigned to this shader variable were explicitly declared in shader code (instead of automatically assigned by the compiler). 11 | * D3D_SVF_USERPACKED 12 | */ 13 | Userpacked = 1, 14 | /** 15 | * Indicates that this variable is used by this shader. 16 | * This value confirms that a particular shader variable (which can be common to many different shaders) is indeed used by a particular shader. 17 | * D3D_SVF_USED 18 | */ 19 | Used = 2, 20 | /** 21 | * Indicates that this variable is an interface. 22 | * D3D_SVF_INTERFACE_POINTER 23 | */ 24 | InterfacePointer = 4, 25 | /** 26 | * 27 | * D3D_SVF_INTERFACE_PARAMETER 28 | */ 29 | InterfaceParameter = 8, 30 | /** 31 | * This value is not used by a programmer; 32 | * it exists to force the enumeration to compile to 32 bits. 33 | * D3D_SVF_FORCE_DWORD 34 | */ 35 | ForceDWord = 0x7fffffff 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DirectX/src/Common/DriverType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | // Native: D3D_DRIVER_TYPE 4 | public enum DriverType : uint32 5 | { 6 | Unknown = 0, // Native: D3D_DRIVER_TYPE_UNKNOWN = 0, 7 | Hardware = Unknown + 1, // Native: D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) , 8 | Reference = Hardware + 1, // Native: D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) , 9 | Null = Reference + 1, // Native: D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) , 10 | Software = Null + 1, // Native: D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) , 11 | Warp = Software + 1, // Native: D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 ) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DirectX/src/Common/FeatureLevel.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | // Native: D3D_FEATURE_LEVEL 4 | public enum FeatureLevel : uint32 5 | { 6 | None = 0, 7 | Level_1_0_Core = 0x1000, // Native: D3D_FEATURE_LEVEL_1_0_CORE 8 | Level_9_1 = 0x9100, // Native: D3D_FEATURE_LEVEL_9_1 9 | Level_9_2 = 0x9200, // Native: D3D_FEATURE_LEVEL_9_2 10 | Level_9_3 = 0x9300, // Native: D3D_FEATURE_LEVEL_9_3 11 | Level_10_0 = 0xa000, // Native: D3D_FEATURE_LEVEL_10_0 12 | Level_10_1 = 0xa100, // Native: D3D_FEATURE_LEVEL_10_1 13 | Level_11_0 = 0xb000, // Native: D3D_FEATURE_LEVEL_11_0 14 | Level_11_1 = 0xb100, // Native: D3D_FEATURE_LEVEL_11_1 15 | Level_12_0 = 0xc000, // Native: D3D_FEATURE_LEVEL_12_0 16 | Level_12_1 = 0xc100, // Native: D3D_FEATURE_LEVEL_12_1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/Common/ID3DBlob.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | /** 6 | * This interface is used to return data of arbitrary length. 7 | */ 8 | public struct ID3DBlob : IUnknown, IComObject 9 | { 10 | public static new Guid IID => .("8BA5FB08-5195-40e2-AC58-0D989C3A0102"); 11 | 12 | public struct VTable : IUnknown.VTable 13 | { 14 | public function [CallingConvention(.Stdcall)] void*(ID3DBlob *self) GetBufferPointer; 15 | public function [CallingConvention(.Stdcall)] SIZE_T(ID3DBlob *self) GetBufferSize; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get 22 | { 23 | return (.)mVT; 24 | } 25 | } 26 | 27 | /** 28 | * Retrieves the size, in bytes, of the blob's data. 29 | * @return The size of the blob's data, in bytes. 30 | */ 31 | public SIZE_T GetBufferSize() mut 32 | { 33 | return VT.GetBufferSize(&this); 34 | } 35 | 36 | /** 37 | * Retrieves a pointer to the blob's data. 38 | * @return A pointer to the blob's data. 39 | */ 40 | public void* GetBufferPointer() mut 41 | { 42 | return VT.GetBufferPointer(&this); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DirectX/src/Common/IncludeType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Values that indicate the location of a shader #include file. 5 | * @native D3D_INCLUDE_TYPE 6 | */ 7 | public enum IncludeType : uint32 8 | { 9 | /** 10 | * The local directory. 11 | * @native D3D_INCLUDE_LOCAL and D3D10_INCLUDE_LOCAL 12 | */ 13 | Local = 0, 14 | /** 15 | * The system directory. 16 | * @native D3D_INCLUDE_SYSTEM and D3D10_INCLUDE_SYSTEM 17 | */ 18 | System = (Local + 1) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/Common/InterpolationMode.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Specifies interpolation mode, which affects how values are calculated during rasterization. 5 | * D3D_INTERPOLATION_MODE 6 | */ 7 | public enum InterpolationMode : uint32 8 | { 9 | /** 10 | * The interpolation mode is undefined. 11 | * D3D_INTERPOLATION_UNDEFINED 12 | */ 13 | Undefined = 0, 14 | /** 15 | * Don't interpolate between register values. 16 | * D3D_INTERPOLATION_CONSTANT 17 | */ 18 | Constant = 1, 19 | /** 20 | * Interpolate linearly between register values. 21 | * D3D_INTERPOLATION_LINEAR 22 | */ 23 | Linear = 2, 24 | /** 25 | * Interpolate linearly between register values but centroid clamped when multisampling. 26 | * D3D_INTERPOLATION_LINEAR_CENTROID 27 | */ 28 | LinearCentroid = 3, 29 | /** 30 | * Interpolate linearly between register values but with no perspective correction. 31 | * D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE 32 | */ 33 | LinearNoPerspective = 4, 34 | /** 35 | * Interpolate linearly between register values but with no perspective correction and centroid clamped when multisampling. 36 | * D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID 37 | */ 38 | LinearNoPerspectiveCentroid = 5, 39 | /** 40 | * Interpolate linearly between register values but sample clamped when multisampling. 41 | * D3D_INTERPOLATION_LINEAR_SAMPLE 42 | */ 43 | LinearSample = 6, 44 | /** 45 | * Interpolate linearly between register values but with no perspective correction and sample clamped when multisampling. 46 | * D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE 47 | */ 48 | LinearNoPerspectiveSample = 7 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DirectX/src/Common/LargerInteger.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | // Todo: das wird niemals funktionieren! 6 | [Union] 7 | public struct LargerInteger 8 | { 9 | struct DUMMYSTRUCTNAME 10 | { 11 | uint32 LowPart; 12 | int32 HighPart; 13 | }struct u 14 | { 15 | uint32 LowPart; 16 | int32 HighPart; 17 | } 18 | int64 QuadPart; 19 | } 20 | 21 | /* 22 | typedef union _LARGE_INTEGER { 23 | struct { 24 | DWORD LowPart; 25 | LONG HighPart; 26 | } DUMMYSTRUCTNAME; 27 | struct { 28 | DWORD LowPart; 29 | LONG HighPart; 30 | } u; 31 | LONGLONG QuadPart; 32 | } LARGE_INTEGER; 33 | */ 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/Common/Luid.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Windows; 3 | 4 | namespace DirectX.Common 5 | { 6 | [CRepr] 7 | /** 8 | * Locally Unique Identifier 9 | */ 10 | public struct Luid 11 | { 12 | DWORD LowPart; 13 | LONG HighPart; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/Common/MinPrecision.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * D3D_MIN_PRECISION 5 | */ 6 | // Todo: 7 | public enum D3DMinPrecision : uint32 8 | { 9 | D3D_MIN_PRECISION_DEFAULT = 0, 10 | D3D_MIN_PRECISION_FLOAT_16 = 1, 11 | D3D_MIN_PRECISION_FLOAT_2_8 = 2, 12 | D3D_MIN_PRECISION_RESERVED = 3, 13 | D3D_MIN_PRECISION_SINT_16 = 4, 14 | D3D_MIN_PRECISION_UINT_16 = 5, 15 | D3D_MIN_PRECISION_ANY_16 = 0xf0, 16 | D3D_MIN_PRECISION_ANY_10 = 0xf1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/Common/ParameterFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Indicates semantic flags for function parameters. 5 | * D3D_PARAMETER_FLAGS 6 | */ 7 | public enum ParameterFlags : uint32 8 | { 9 | /** 10 | * The parameter has no semantic flags. 11 | * D3D_PF_NONE 12 | */ 13 | None = 0, 14 | /** 15 | * Indicates an input parameter. 16 | * D3D_PF_IN 17 | */ 18 | In = 0x1, 19 | /** 20 | * Indicates an output parameter. 21 | * D3D_PF_OUT 22 | */ 23 | Out = 0x2, 24 | /** 25 | * Forces this enumeration to compile to 32 bits in size. 26 | * Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. 27 | * This value is not used. 28 | * D3D_PF_FORCE_DWORD 29 | */ 30 | ForceDWord = 0x7fffffff 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DirectX/src/Common/Primitive.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | public enum Primitive : uint32 4 | { 5 | D3D_PRIMITIVE_UNDEFINED = 0, 6 | D3D_PRIMITIVE_POINT = 1, 7 | D3D_PRIMITIVE_LINE = 2, 8 | D3D_PRIMITIVE_TRIANGLE = 3, 9 | D3D_PRIMITIVE_LINE_ADJ = 6, 10 | D3D_PRIMITIVE_TRIANGLE_ADJ = 7, 11 | D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, 12 | D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, 13 | D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, 14 | D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, 15 | D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, 16 | D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, 17 | D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, 18 | D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, 19 | D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, 20 | D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, 21 | D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, 22 | D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, 23 | D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, 24 | D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, 25 | D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, 26 | D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, 27 | D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, 28 | D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, 29 | D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, 30 | D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, 31 | D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, 32 | D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, 33 | D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, 34 | D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, 35 | D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, 36 | D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, 37 | D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, 38 | D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, 39 | D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, 40 | D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, 41 | D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, 42 | D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 39, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DirectX/src/Common/ResourceReturnType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Indicates return value type. 5 | * D3D_RESOURCE_RETURN_TYPE 6 | */ 7 | public enum ResourceReturnType : uint32 8 | { 9 | /** 10 | * Return type is UNORM. 11 | * D3D_RETURN_TYPE_UNORM 12 | */ 13 | UNorm = 1, 14 | /** 15 | * Return type is SNORM. 16 | * D3D_RETURN_TYPE_SNORM 17 | */ 18 | SNorm = 2, 19 | /** 20 | * Return type is SINT. 21 | * D3D_RETURN_TYPE_SINT 22 | */ 23 | SInt = 3, 24 | /** 25 | * Return type is UINT. 26 | * D3D_RETURN_TYPE_UINT 27 | */ 28 | UInt = 4, 29 | /** 30 | * Return type is FLOAT. 31 | * D3D_RETURN_TYPE_FLOAT 32 | */ 33 | Float = 5, 34 | /** 35 | * Return type is unknown. 36 | * D3D_RETURN_TYPE_MIXED 37 | */ 38 | Mixed = 6, 39 | /** 40 | * Return type is DOUBLE. 41 | * D3D_RETURN_TYPE_DOUBLE 42 | */ 43 | Double = 7, 44 | /** 45 | * Return type is a multiple-dword type, such as a double or uint64, and the component is continued from the previous component that was declared. 46 | * The first component represents the lower bits. 47 | * D3D_RETURN_TYPE_CONTINUED 48 | */ 49 | Continued = 8, 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DirectX/src/Common/ShaderInputFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Values that identify shader-input options. 5 | * D3D_SHADER_INPUT_FLAGS 6 | */ 7 | public enum ShaderInputFlags : uint32 8 | { 9 | /** 10 | * Assign a shader input to a register based on the register assignment in the HLSL code (instead of letting the compiler choose the register). 11 | * D3D_SIF_USERPACKED 12 | */ 13 | Userpacked = 0x1, 14 | /** 15 | * Use a comparison sampler, which uses the SampleCmp (DirectX HLSL Texture Object) and SampleCmpLevelZero (DirectX HLSL Texture Object) sampling functions. 16 | * D3D_SIF_COMPARISON_SAMPLER 17 | */ 18 | ComparisonSampler = 0x2, 19 | /** 20 | * A 2-bit value for encoding texture components. 21 | * D3D_SIF_TEXTURE_COMPONENT_0 22 | */ 23 | TextureComponents0 = 0x4, 24 | /** 25 | * A 2-bit value for encoding texture components. 26 | * D3D_SIF_TEXTURE_COMPONENT_1 27 | */ 28 | TextureComponents1 = 0x8, 29 | /** 30 | * A 2-bit value for encoding texture components. 31 | * D3D_SIF_TEXTURE_COMPONENTS 32 | */ 33 | TextureComponents = 0xc, 34 | /** 35 | * This value is reserved. 36 | * D3D_SIF_UNUSED 37 | */ 38 | Unused = 0x10, 39 | /** 40 | * Forces the enumeration to compile to 32 bits. 41 | * This value is not used directly by titles. 42 | * D3D_SIF_FORCE_DWORD 43 | */ 44 | ForceDWord = 0x7fffffff 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DirectX/src/Common/ShaderMacro.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Common 4 | { 5 | /** 6 | Defines a shader macro. 7 | D3D_SHADER_MACRO 8 | */ 9 | [CRepr] 10 | public struct ShaderMacro 11 | { 12 | /** 13 | * The macro name. 14 | */ 15 | public char16 *Name; 16 | /** 17 | * The macro definition. 18 | */ 19 | public char16 *Definition; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DirectX/src/Common/ShaderResourceViewDimension.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | These flags identify the type of resource that will be viewed as a shader resource. 5 | D3D11_SRV_DIMENSION 6 | */ 7 | public enum ShaderResourceViewDimension : uint32 8 | { 9 | /** 10 | The type is unknown. 11 | D3D11_SRV_DIMENSION_UNKNOWN 12 | */ 13 | Unknown = 0, 14 | /** 15 | The resource is a buffer. 16 | D3D11_SRV_DIMENSION_BUFFER 17 | */ 18 | Buffer = 1, 19 | /** 20 | The resource is a 1D texture. 21 | D3D11_SRV_DIMENSION_TEXTURE1D 22 | */ 23 | Texture1D = 2, 24 | /** 25 | The resource is an array of 1D textures. 26 | D3D11_SRV_DIMENSION_TEXTURE1DARRAY 27 | */ 28 | Texture1DArray = 3, 29 | /** 30 | The resource is a 2D texture. 31 | D3D11_SRV_DIMENSION_TEXTURE2D 32 | */ 33 | Texture2D = 4, 34 | /** 35 | The resource is an array of 2D textures. 36 | D3D11_SRV_DIMENSION_TEXTURE2DARRAY 37 | */ 38 | Texture2DArray = 5, 39 | /** 40 | The resource is a multisampling 2D texture. 41 | D3D11_SRV_DIMENSION_TEXTURE2DMS 42 | */ 43 | Texture2DMultisampled = 6, 44 | /** 45 | The resource is an array of multisampling 2D textures. 46 | D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY 47 | */ 48 | Texture2DMultisampledArray= 7, 49 | /** 50 | The resource is a 3D texture. 51 | D3D11_SRV_DIMENSION_TEXTURE3D 52 | */ 53 | Texture3D = 8, 54 | /** 55 | The resource is a cube texture. 56 | D3D11_SRV_DIMENSION_TEXTURECUBE 57 | */ 58 | TextureCube = 9, 59 | /** 60 | The resource is an array of cube textures. 61 | D3D11_SRV_DIMENSION_TEXTURECUBEARRAY 62 | */ 63 | TextureCubeArray = 10, 64 | /** 65 | The resource is a raw buffer. 66 | D3D11_SRV_DIMENSION_BUFFEREX 67 | */ 68 | BufferEx = 11 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /DirectX/src/Common/ShaderVariableClass.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Values that identify the class of a shader variable. 5 | * D3D_SHADER_VARIABLE_CLASS 6 | */ 7 | public enum ShaderVariableClass : uint32 8 | { 9 | /** 10 | * The shader variable is a scalar. 11 | * D3D_SVC_SCALAR 12 | */ 13 | Scalar = 0, 14 | /** 15 | * The shader variable is a vector. 16 | * D3D_SVC_VECTOR 17 | */ 18 | Vector = ( Scalar + 1 ) , 19 | /** 20 | * The shader variable is a row-major matrix. 21 | * D3D_SVC_MATRIX_ROWS 22 | */ 23 | MatrixRowMajor = ( Vector + 1 ) , 24 | /** 25 | * The shader variable is a column-major matrix. 26 | * D3D_SVC_MATRIX_COLUMNS 27 | */ 28 | MatrixColumnMajor = ( MatrixRowMajor + 1 ) , 29 | /** 30 | * The shader variable is an object. 31 | * D3D_SVC_OBJECT 32 | */ 33 | Object = ( MatrixColumnMajor + 1 ) , 34 | /** 35 | * The shader variable is a structure. 36 | * D3D_SVC_STRUCT 37 | */ 38 | Struct = ( Object + 1 ) , 39 | /** 40 | * The shader variable is a class. 41 | * D3D_SVC_INTERFACE_CLASS 42 | */ 43 | InterfaceClass = ( Struct + 1 ) , 44 | /** 45 | * The shader variable is an interface. 46 | * D3D_SVC_INTERFACE_POINTER 47 | */ 48 | InterfacePointer = ( InterfaceClass + 1 ) , 49 | /** 50 | * This value is not used by a programmer; 51 | * it exists to force the enumeration to compile to 32 bits. 52 | * D3D_SVC_FORCE_DWORD 53 | */ 54 | ForceDWord = 0x7fffffff 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DirectX/src/Common/TessellatorDomain.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Domain options for tessellator data. 5 | * D3D_TESSELLATOR_DOMAIN 6 | */ 7 | public enum TessellatorDomain : uint32 8 | { 9 | /** 10 | * The data type is undefined. 11 | * D3D_TESSELLATOR_DOMAIN_UNDEFINED 12 | */ 13 | Undefined = 0, 14 | /** 15 | * Isoline data. 16 | * D3D_TESSELLATOR_DOMAIN_ISOLINE 17 | */ 18 | Isoline = 1, 19 | /** 20 | * Triangle data. 21 | * D3D_TESSELLATOR_DOMAIN_TRI 22 | */ 23 | Tri = 2, 24 | /** 25 | * Quad data. 26 | * D3D_TESSELLATOR_DOMAIN_QUAD 27 | */ 28 | Quad = 3, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/Common/TessellatorOutputPrimitive.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Output primitive types. 5 | * D3D_TESSELLATOR_OUTPUT_PRIMITIVE 6 | */ 7 | public enum TessellatorOutputPrimitive : uint32 8 | { 9 | /** 10 | * The output primitive type is undefined. 11 | * D3D_TESSELLATOR_OUTPUT_UNDEFINED 12 | */ 13 | Undefinied = 0, 14 | /** 15 | * The output primitive type is a point. 16 | * D3D_TESSELLATOR_OUTPUT_POINT 17 | */ 18 | Point = 1, 19 | /** 20 | * The output primitive type is a line. 21 | * D3D_TESSELLATOR_OUTPUT_LINE 22 | */ 23 | Line = 2, 24 | /** 25 | * The output primitive type is a clockwise triangle. 26 | * D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW 27 | */ 28 | TriangleClockWise = 3, 29 | /** 30 | * The output primitive type is a counter clockwise triangle. 31 | * D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW 32 | */ 33 | TriangleCounterClockWise = 4, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/Common/TessellatorPartitioning.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * Partitioning options. 5 | * D3D_TESSELLATOR_PARTITIONING 6 | */ 7 | public enum TessellatorPartitioning : uint32 8 | { 9 | /** 10 | * The partitioning type is undefined. 11 | * D3D_TESSELLATOR_PARTITIONING_UNDEFINED 12 | */ 13 | Undefined = 0, 14 | /** 15 | * Partition with integers only. 16 | * D3D_TESSELLATOR_PARTITIONING_INTEGER 17 | */ 18 | Integer = 1, 19 | /** 20 | * Partition with a power-of-two number only. 21 | * D3D_TESSELLATOR_PARTITIONING_POW2 22 | */ 23 | Pow2 = 2, 24 | /** 25 | * Partition with an odd, fractional number. 26 | * D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD 27 | */ 28 | Odd = 3, 29 | /** 30 | * Partition with an even, fractional number. 31 | * D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN 32 | */ 33 | Even = 4, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/AsyncGetDataFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Optional flags that control the behavior of ID3D11DeviceContext::GetData. 5 | * D3D11_ASYNC_GETDATA_FLAG 6 | */ 7 | public enum AsyncGetDataFlags : UINT 8 | { 9 | /** No flags specified */ 10 | None = 0x00, 11 | /** 12 | * Do not flush the command buffer. 13 | * This can potentially cause an infinite loop if GetData is continually 14 | * called until it returns S_OK as there may still be commands in the 15 | * command buffer that need to be processed in order for GetData to return S_OK. 16 | * Since the commands in the command buffer are not flushed they will not be 17 | * processed and therefore GetData will never return S_OK. 18 | * D3D11_ASYNC_GETDATA_DONOTFLUSH 19 | */ 20 | DoNotFlush = 0x01 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/BlendDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | Describes the blend state that you use in a call to ID3D11Device::CreateBlendState to create a blend-state object. 7 | */ 8 | [CRepr] 9 | public struct BlendDescription 10 | { 11 | /** 12 | Specifies whether to use alpha-to-coverage as a multisampling technique when setting a pixel to a render target. 13 | For more info about using alpha-to-coverage, see Alpha-To-Coverage. 14 | */ 15 | public BOOL AlphaToCoverageEnable; 16 | /** 17 | Specifies whether to enable independent blending in simultaneous render targets. Set to TRUE to enable independent blending. 18 | If set to FALSE, only the RenderTarget[0] members are used; RenderTarget[1..7] are ignored. 19 | */ 20 | public BOOL IndependentBlendEnable; 21 | /** 22 | An array of D3D11_RENDER_TARGET_BLEND_DESC structures that describe the blend states for render targets; 23 | these correspond to the eight render targets that can be bound to the output-merger stage at one time. 24 | */ 25 | public RenderTargetBlendDescription[8] RenderTarget; 26 | 27 | public this() 28 | { 29 | this = default; 30 | } 31 | 32 | public static this() 33 | { 34 | Default = .(); 35 | Default.AlphaToCoverageEnable = false; 36 | Default.IndependentBlendEnable = false; 37 | 38 | for(int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++) 39 | { 40 | Default.RenderTarget[i] = .Default; 41 | } 42 | } 43 | 44 | public static readonly BlendDescription Default; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/BlendOperation.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | RGB or alpha blending operation. 5 | D3D11_BLEND_OP 6 | */ 7 | public enum BlendOperation : UINT 8 | { 9 | /** 10 | Add source 1 and source 2. 11 | D3D11_BLEND_OP_ADD 12 | */ 13 | Add = 1, 14 | /** 15 | Subtract source 1 from source 2. 16 | D3D11_BLEND_OP_SUBTRACT 17 | */ 18 | Subtract = 2, 19 | /** 20 | Subtract source 2 from source 1. 21 | D3D11_BLEND_OP_REV_SUBTRACT 22 | */ 23 | ReversedSubtract = 3, 24 | /** 25 | Find the minimum of source 1 and source 2. 26 | D3D11_BLEND_OP_MIN 27 | */ 28 | Min = 4, 29 | /** 30 | Find the maximum of source 1 and source 2. 31 | D3D11_BLEND_OP_MAX 32 | */ 33 | Max = 5 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/Box.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | Defines a 3D box, where the origin is the left, front, top corner. 7 | D3D11_BOX 8 | */ 9 | [CRepr] 10 | public struct Box 11 | { 12 | /// The x position of the left hand side of the box. 13 | public uint32 Left; 14 | /// The y position of the top of the box. 15 | public uint32 Top; 16 | /// The z position of the front of the box. 17 | public uint32 Front; 18 | /// The x position of the right hand side of the box. 19 | public uint32 Right; 20 | /// The y position of the bottom of the box. 21 | public uint32 Bottom; 22 | /// The z position of the back of the box. 23 | public uint32 Back; 24 | 25 | /** 26 | Returns true if the box is empty. 27 | A box is empty if the top value is greater than or equal to the bottom value, 28 | or the left value is greater than or equal to the right value, 29 | or the front value is greater than or equal to the back value. 30 | */ 31 | public bool IsEmpty => Top >= Bottom || Left >= Right || Front >= Back; 32 | 33 | /** 34 | * Instantiates a new instance of an uninitialized Box structure. 35 | */ 36 | public this() 37 | { 38 | this = default; 39 | } 40 | 41 | /** 42 | * Instantiates a new instance of a Box structure that is initialized with the dimensions of a box. 43 | */ 44 | public this(uint32 left, uint32 top, uint32 front, uint32 right, uint32 bottom, uint32 back) 45 | { 46 | Left = left; 47 | Top = top; 48 | Front = front; 49 | Right = right; 50 | Bottom = bottom; 51 | Back = back; 52 | } 53 | 54 | [Inline] 55 | public static bool operator ==(Box l, Box r) 56 | { 57 | return l.Left == r.Left && l.Top == r.Top && l.Front == r.Front && 58 | l.Right == r.Right && l.Bottom == r.Bottom && l.Back == r.Back; 59 | } 60 | 61 | [Inline] 62 | public static bool operator !=(Box l, Box r) 63 | { 64 | return !(l == r); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/BufferExShaderResourceViewFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Identifies how to view a buffer resource. 5 | */ 6 | public enum BufferExShaderResourceViewFlags : uint32 7 | { 8 | /** 9 | * View the buffer as raw. 10 | */ 11 | Raw = 0x1, 12 | /** 13 | * None, not a valid option. 14 | */ 15 | None = 0 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/BufferUavFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Identifies unordered-access view options for a buffer resource. 5 | */ 6 | public enum BufferUavFlags : uint32 7 | { 8 | /// No BufferUavFlags specified. 9 | None = 0, 10 | /** 11 | * Resource contains raw, unstructured data. 12 | * Requires the UAV format to be Format.R32_Typeless. 13 | * D3D11_BUFFER_UAV_FLAG_RAW 14 | */ 15 | Raw = 0x1, 16 | /** 17 | * Allow data to be appended to the end of the buffer. 18 | * BufferUavFlags.Append flag must also be used for any 19 | * view that will be used as a AppendStructuredBuffer or a ConsumeStructuredBuffer. 20 | * Requires the UAV format to be Format.Unknown. 21 | * D3D11_BUFFER_UAV_FLAG_APPEND 22 | */ 23 | Append = 0x2, 24 | /** 25 | * Adds a counter to the unordered-access-view buffer. 26 | * BufferUavFlags.Counter can only be used on a UAV that is a RWStructuredBuffer and it 27 | * enables the functionality needed for the IncrementCounterand DecrementCounter methods in HLSL. 28 | * Requires the UAV format to be DXGI_FORMAT_UNKNOWN. 29 | * D3D11_BUFFER_UAV_FLAG_COUNTER 30 | */ 31 | Counter = 0x4 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/CPUAccessFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Specifies the types of CPU access allowed for a resource. 5 | D3D11_CPU_ACCESS_FLAG 6 | */ 7 | public enum CpuAccessFlags : uint32 8 | { 9 | /** 10 | The resource is to be mappable so that the CPU can change its contents. 11 | Resources created with this flag cannot be set as outputs of the pipeline and must be created with either dynamic or staging usage. 12 | D3D11_CPU_ACCESS_WRITE 13 | */ 14 | Write = 0x10000L, 15 | /** 16 | The resource is to be mappable so that the CPU can read its contents. 17 | Resources created with this flag cannot be set as either inputs or outputs to the pipeline and must be created with staging usage. 18 | D3D11_CPU_ACCESS_READ 19 | */ 20 | Read = 0x20000L, 21 | /** 22 | No CPU access. When possible, create resources with no CPU access, as this enables better resource optimization. 23 | */ 24 | None = 0 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ClassInstanceDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | Describes an HLSL class instance. 8 | */ 9 | [CRepr] 10 | public struct ClassInstanceDescription 11 | { 12 | /** 13 | The instance ID of an HLSL class; the default value is 0. 14 | */ 15 | public UINT InstanceId; 16 | /** 17 | The instance index of an HLSL class; the default value is 0. 18 | */ 19 | public UINT InstanceIndex; 20 | /** 21 | The type ID of an HLSL class; the default value is 0. 22 | */ 23 | public UINT TypeId; 24 | /** 25 | Describes the constant buffer associated with an HLSL class; the default value is 0. 26 | */ 27 | public UINT ConstantBuffer; 28 | /** 29 | The base constant buffer offset associated with an HLSL class; the default value is 0. 30 | */ 31 | public UINT BaseConstantBufferOffset; 32 | /** 33 | The base texture associated with an HLSL class; the default value is 127. 34 | */ 35 | public UINT BaseTexture; 36 | /** 37 | The base sampler associated with an HLSL class; the default value is 15. 38 | */ 39 | public UINT BaseSampler; 40 | /** 41 | True if the class was created; the default value is false. 42 | */ 43 | public BOOL Created; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ClearFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Specifies the parts of the depth stencil to clear. 5 | D3D11_CLEAR_FLAG 6 | */ 7 | public enum ClearFlag : uint32 8 | { 9 | /** 10 | Clear the depth buffer, using fast clear if possible, then place the resource in a compressed state. 11 | D3D11_CLEAR_DEPTH 12 | */ 13 | Depth = 0x1L, 14 | /** 15 | Clear the stencil buffer, using fast clear if possible, then place the resource in a compressed state. 16 | D3D11_CLEAR_STENCIL 17 | */ 18 | Stencil = 0x2L 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ColorWriteEnable.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Identify which components of each pixel of a render target are writable during blending. 5 | These flags can be combined with a bitwise OR. 6 | D3D11_COLOR_WRITE_ENABLE 7 | */ 8 | public enum ColorWriteEnable : uint8 9 | { 10 | /** 11 | Allows no data to be stored. 12 | */ 13 | None = 0, 14 | /** 15 | Allow data to be stored in the red component. 16 | */ 17 | Red = 1, 18 | /** 19 | Allow data to be stored in the green component. 20 | */ 21 | Green = 2, 22 | /** 23 | Allow data to be stored in the blue component. 24 | */ 25 | Blue = 4, 26 | /** 27 | Allow data to be stored in the alpha component. 28 | */ 29 | Alpha = 8, 30 | /** 31 | Allow data to be stored in all components. 32 | */ 33 | All = .Red | .Green | .Blue | .Alpha 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ComparisonFunction.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Comparison options. 5 | D3D11_COMPARISON_FUNC 6 | */ 7 | public enum ComparisonFunction : uint32 8 | { 9 | /** 10 | Never pass the comparison. 11 | D3D11_COMPARISON_NEVER 12 | */ 13 | Never = 1, 14 | /** 15 | If the source data is less than the destination data, the comparison passes. 16 | D3D11_COMPARISON_LESS 17 | */ 18 | Less = 2, 19 | /** 20 | If the source data is equal to the destination data, the comparison passes. 21 | D3D11_COMPARISON_EQUAL 22 | */ 23 | Equal = 3, 24 | /** 25 | If the source data is less than or equal to the destination data, the comparison passes. 26 | D3D11_COMPARISON_LESS_EQUAL 27 | */ 28 | LessOrEqual = 4, 29 | /** 30 | If the source data is greater than the destination data, the comparison passes. 31 | D3D11_COMPARISON_GREATER 32 | */ 33 | Greater = 5, 34 | /** 35 | If the source data is not equal to the destination data, the comparison passes. 36 | D3D11_COMPARISON_NOT_EQUAL 37 | */ 38 | NotEqual = 6, 39 | /** 40 | If the source data is greater than or equal to the destination data, the comparison passes. 41 | D3D11_COMPARISON_GREATER_EQUAL 42 | */ 43 | GreaterOrEqual = 7, 44 | /** 45 | Always pass the comparison. 46 | D3D11_COMPARISON_ALWAYS 47 | */ 48 | Always = 8 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ConservativeRasterizationTier.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Specifies if the hardware and driver support conservative rasterization and at what tier level. 5 | * D3D11_CONSERVATIVE_RASTERIZATION_TIER 6 | */ 7 | public enum ConservativeRasterizationTier : uint32 8 | { 9 | /** 10 | * Conservative rasterization isn't supported. 11 | * D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED 12 | */ 13 | NotSupported = 0, 14 | /** 15 | * Tier_1 conservative rasterization is supported. 16 | * D3D11_CONSERVATIVE_RASTERIZATION_TIER_1 17 | */ 18 | Tier1 = 1, 19 | /** 20 | * Tier_2 conservative rasterization is supported. 21 | * D3D11_CONSERVATIVE_RASTERIZATION_TIER_2 22 | */ 23 | Tier2 = 2, 24 | /** 25 | * Tier_3 conservative rasterization is supported. 26 | * D3D11_CONSERVATIVE_RASTERIZATION_TIER_3 27 | */ 28 | Tier3 = 3, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/Counter.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Options for performance counters. 5 | */ 6 | public enum Counter : uint32 7 | { 8 | /** 9 | * Define a performance counter that is dependent on the hardware device. 10 | */ 11 | DeviceDependent0 = 0x40000000 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/CounterDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Options for performance counters. 7 | */ 8 | [CRepr] 9 | public struct CounterDescription 10 | { 11 | /** 12 | * Type of counter. 13 | */ 14 | public Counter Counter; 15 | /** 16 | * Reserved. 17 | */ 18 | public UINT MiscFlags; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/CounterInfo.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Information about the video card's performance counter capabilities. 7 | */ 8 | [CRepr] 9 | public struct CounterInfo 10 | { 11 | /** 12 | * Largest device-dependent counter ID that the device supports. 13 | * If none are supported, this value will be 0. 14 | * Otherwise it will be greater than or equal to Counter.DeviceDependent0. 15 | */ 16 | public Counter LastDeviceDependentCounter; 17 | /** 18 | * Number of counters that can be simultaneously supported. 19 | */ 20 | public uint32 NumSimultaneousCounters; 21 | /** 22 | * Number of detectable parallel units that the counter is able to discern. 23 | * Values are 1 ~ 4. 24 | * Use NumDetectableParallelUnits to interpret the values of the VERTEX_PROCESSING, GEOMETRY_PROCESSING, PIXEL_PROCESSING, and OTHER_GPU_PROCESSING counters. 25 | */ 26 | public uint8 NumDetectableParallelUnits; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/CounterType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Data type of a performance counter. 5 | */ 6 | public enum CounterType : uint32 7 | { 8 | /** 9 | * 32-bit floating point. 10 | */ 11 | Float32 = 0, 12 | /** 13 | * 16-bit unsigned integer. 14 | */ 15 | Uint16 = (Float32 + 1), 16 | /** 17 | * 32-bit unsigned integer. 18 | */ 19 | Uint32 = (Uint16 + 1), 20 | /** 21 | * 64-bit unsigned integer. 22 | */ 23 | Uint64 = (Uint32 + 1) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/CullMode.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Indicates triangles facing a particular direction are not drawn. 5 | D3D11_CULL_MODE 6 | */ 7 | public enum CullMode : uint32 8 | { 9 | /** 10 | Always draw all triangles. 11 | D3D11_CULL_NONE 12 | */ 13 | None = 1, 14 | /** 15 | Do not draw triangles that are front-facing. 16 | D3D11_CULL_FRONT 17 | */ 18 | Front = 2, 19 | /** 20 | Do not draw triangles that are back-facing. 21 | D3D11_CULL_BACK 22 | */ 23 | Back = 3 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DepthStencilOperationDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | Stencil operations that can be performed based on the results of stencil test. 7 | D3D11_DEPTH_STENCILOP_DESC 8 | */ 9 | [CRepr] 10 | public struct DepthStencilOperationDescription 11 | { 12 | /** 13 | The stencil operation to perform when stencil testing fails. 14 | */ 15 | public StencilOperation StencilFailOp; 16 | /** 17 | The stencil operation to perform when stencil testing passes and depth testing fails. 18 | */ 19 | public StencilOperation StencilDepthFailOp; 20 | /** 21 | The stencil operation to perform when stencil testing and depth testing both pass. 22 | */ 23 | public StencilOperation StencilPassOp; 24 | /** 25 | A function that compares stencil data against existing stencil data. 26 | */ 27 | public ComparisonFunction StencilFunc; 28 | 29 | /** 30 | Initializes a new instance of a DepthStencilOperationDescription with all zero values. 31 | */ 32 | public this() 33 | { 34 | this = default; 35 | } 36 | 37 | /** 38 | Initializes a new instance of a DepthStencilOperationDescription with the specified values. 39 | */ 40 | public this(StencilOperation stencilFailOp, StencilOperation stencilDepthFailOp, StencilOperation stencilPassOp, ComparisonFunction stencilFunc) 41 | { 42 | StencilFailOp = stencilFailOp; 43 | StencilDepthFailOp = stencilDepthFailOp; 44 | StencilPassOp = stencilPassOp; 45 | StencilFunc = stencilFunc; 46 | } 47 | 48 | public static readonly DepthStencilOperationDescription Default = .(.Keep, .Keep, .Keep, .Always); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DepthStencilViewDimension.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Specifies how to access a resource used in a depth-stencil view. 5 | D3D11_DSV_DIMENSION 6 | */ 7 | public enum DepthStencilViewDimension : uint32 8 | { 9 | /** 10 | Unknown is not a valid value for DepthStencilViewDimension and is not used. 11 | D3D11_DSV_DIMENSION_UNKNOWN 12 | */ 13 | Unknown = 0, 14 | /** 15 | The resource will be accessed as a 1D texture. 16 | D3D11_DSV_DIMENSION_TEXTURE1D 17 | */ 18 | Texture1D = 1, 19 | /** 20 | The resource will be accessed as an array of 1D texture. 21 | D3D11_DSV_DIMENSION_TEXTURE1DARRAY 22 | */ 23 | Texture1DArray = 2, 24 | /** 25 | The resource will be accessed as a 2D texture. 26 | D3D11_DSV_DIMENSION_TEXTURE2D 27 | */ 28 | Texture2D = 3, 29 | /** 30 | The resource will be accessed as an array of 2D texture. 31 | D3D11_DSV_DIMENSION_TEXTURE2DARRAY 32 | */ 33 | Texture2DArray = 4, 34 | /** 35 | The resource will be accessed as a 2D texture with multisampling. 36 | D3D11_DSV_DIMENSION_TEXTURE2DMS 37 | */ 38 | Texture2DMultisampled = 5, 39 | /** 40 | The resource will be accessed as an array of 2D textures with multisampling. 41 | D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY 42 | */ 43 | Texture2DMultisampledArray = 6, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DepthStencilViewFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Depth-stencil view options. 5 | D3D11_DSV_FLAG 6 | */ 7 | public enum DepthStencilViewOptions : uint32 8 | { 9 | /** 10 | Indicates that depth values are read only. 11 | D3D11_DSV_READ_ONLY_DEPTH 12 | */ 13 | ReadOnlyDepth = 0x1L, 14 | /** 15 | Indicates that stencil values are read only. 16 | D3D11_DSV_READ_ONLY_STENCIL 17 | */ 18 | ReadOnlyStencil = 0x2L, 19 | /** 20 | Indicates that neither depth nor stencil values are read only. 21 | */ 22 | None = 0 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DepthWriteMask.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Identify the portion of a depth-stencil buffer for writing depth data. 5 | D3D11_DEPTH_WRITE_MASK 6 | */ 7 | public enum DepthWriteMask : uint32 8 | { 9 | /** 10 | Turn off writes to the depth-stencil buffer. 11 | D3D11_DEPTH_WRITE_MASK_ZERO 12 | */ 13 | Zero = 0, 14 | /** 15 | Turn on writes to the depth-stencil buffer. 16 | D3D11_DEPTH_WRITE_MASK_ALL 17 | */ 18 | All = 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DeviceContextStages/StreamOutputStage.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.DXGI; 3 | using DirectX.Math; 4 | using DirectX.Common; 5 | 6 | namespace DirectX.D3D11.DeviceContextStages 7 | { 8 | /** 9 | * Provides access to the device contexts methods for the stream output stage. 10 | */ 11 | public struct StreamOutputStage 12 | { 13 | ID3D11DeviceContext.VTable* mVT; 14 | 15 | [Inline] 16 | public ID3D11DeviceContext.VTable* VT => mVT; 17 | 18 | /** 19 | * Get the target output buffers for the stream-output stage of the pipeline. 20 | * A maximum of four output buffers can be retrieved. 21 | * 22 | @param numBuffers Number of buffers to get. 23 | @param ppSOTargets An array of output buffers (see ID3D11Buffer) to be retrieved from the device. 24 | */ 25 | public void GetTargets(UINT numBuffers, ID3D11Buffer **ppSOTargets) mut 26 | { 27 | VT.SOGetTargets((.)&this, numBuffers, ppSOTargets); 28 | } 29 | 30 | /** 31 | * Set the target output buffers for the stream-output stage of the pipeline. 32 | * 33 | @param numBuffers The number of buffer to bind to the device. A maximum of four output buffers can be set. 34 | If less than four are defined by the call, the remaining buffer slots are set to NULL. 35 | @param ppSOTargets The array of output buffers (see ID3D11Buffer) to bind to the device. 36 | The buffers must have been created with the D3D11_BIND_STREAM_OUTPUT flag. 37 | @param pOffsets Array of offsets to the output buffers from ppSOTargets, one offset for each buffer. T 38 | he offset values must be in bytes. 39 | */ 40 | public void SetTargets(UINT numBuffers, ID3D11Buffer **ppSOTargets, UINT *pOffsets) mut 41 | { 42 | VT.SOSetTargets((.)&this, numBuffers, ppSOTargets, pOffsets); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DeviceContextType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Device context options. 5 | D3D11_DEVICE_CONTEXT_TYPE 6 | */ 7 | public enum DeviceContextType : uint32 8 | { 9 | /** 10 | The device context is an immediate context. 11 | D3D11_DEVICE_CONTEXT_IMMEDIATE 12 | */ 13 | Immediate = 0, 14 | /** 15 | The device context is a deferred context. 16 | D3D11_DEVICE_CONTEXT_DEFERRED 17 | */ 18 | Deferred = 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DeviceCreationFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | // Native: D3D11_CREATE_DEVICE_FLAG 4 | public enum DeviceCreationFlags : uint32 5 | { 6 | None = 0x0, // Native: D3D11_CREATE_DEVICE_NONE = 0x0, 7 | Singlethreaded = 0x1, // Native: D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1, 8 | Debug = 0x2, // Native: D3D11_CREATE_DEVICE_DEBUG = 0x2, 9 | SwitchToRef = 0x4, // Native: D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4, 10 | PreventThreadingOptimizations = 0x8, // Native: D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, 11 | BrgaSupport = 0x20, // Native: D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20, 12 | Debuggable = 0x40, // Native: D3D11_CREATE_DEVICE_DEBUGGABLE = 0x40, 13 | PreventAleringLayerSettingsFromRegistry = 0x80, // Native: D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80, 14 | DisableGpuTimeout = 0x100, // Native: D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x100, 15 | VideoSupport = 0x800 // Native: D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x800 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DrawIndexedInstancedIndirectArgs.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Arguments for draw indexed instanced indirect. 7 | * D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS 8 | */ 9 | [CRepr] 10 | public struct DrawIndexedInstancedIndirectArgs 11 | { 12 | /// The number of indices read from the index buffer for each instance. 13 | public UINT IndexCountPerInstance; 14 | /// The number of instances to draw. 15 | public UINT InstanceCount; 16 | /// The location of the first index read by the GPU from the index buffer. 17 | public UINT StartIndexLocation; 18 | /// A value added to each index before reading a vertex from the vertex buffer. 19 | public INT BaseVertexLocation; 20 | /// A value added to each index before reading per-instance data from a vertex buffer. 21 | public UINT StartInstanceLocation; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/DrawInstancedIndirectArgs.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Arguments for draw instanced indirect. 7 | * D3D11_DRAW_INSTANCED_INDIRECT_ARGS 8 | */ 9 | [CRepr] 10 | public struct DrawInstancedIndirectArgs 11 | { 12 | /// The number of vertices to draw. 13 | public UINT VertexCountPerInstance; 14 | /// The number of instances to draw. 15 | public UINT InstanceCount; 16 | /// The index of the first vertex. 17 | public UINT StartVertexLocation; 18 | /// A value added to each index before reading per-instance data from a vertex buffer. 19 | public UINT StartInstanceLocation; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/FillMode.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Determines the fill mode to use when rendering triangles. 5 | D3D11_FILL_MODE 6 | */ 7 | public enum FillMode : uint32 8 | { 9 | /** 10 | Draw lines connecting the vertices. Adjacent vertices are not drawn. 11 | D3D11_FILL_WIREFRAME 12 | */ 13 | Wireframe = 2, 14 | /** 15 | Fill the triangles formed by the vertices. Adjacent vertices are not drawn. 16 | D3D11_FILL_SOLID 17 | */ 18 | Solid = 3 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Asynchronous.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * This interface encapsulates methods for retrieving data from the GPU asynchronously. 8 | */ 9 | public struct ID3D11Asynchronous : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("4b35d0cd-1e15-4258-9c98-1b1333f6dd3b"); 12 | 13 | public struct VTable : ID3D11DeviceChild.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] UINT(ID3D11Asynchronous *self) GetDataSize; 16 | } 17 | 18 | public new VTable* VT => (.)mVT; 19 | 20 | /** 21 | * Get the size of the data (in bytes) that is output when calling ID3D11DeviceContext::GetData. 22 | * 23 | * @return Size of the data (in bytes) that is output when calling GetData. 24 | */ 25 | public UINT GetDataSize() mut 26 | { 27 | return VT.GetDataSize(&this); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11BlendState.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * The blend-state interface holds a description for blending state that you can bind to the output-merger stage. 8 | */ 9 | public struct ID3D11BlendState : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => .("75b68faa-347d-4159-8f45-a0640f01cd9a"); 12 | 13 | public struct VTable : ID3D11DeviceChild.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11BlendState* self, BlendDescription *pDesc)GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Gets the description for blending state that you used to create the blend-state object. 26 | * 27 | * @param description The reference that receives a description of the blend state. 28 | */ 29 | public void GetDescription(out BlendDescription description) mut 30 | { 31 | description = ?; 32 | VT.GetDesc(&this, &description); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Buffer.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A buffer interface accesses a buffer resource, which is unstructured memory. Buffers typically store vertex or index data. 8 | */ 9 | public struct ID3D11Buffer : ID3D11Resource, IComObject 10 | { 11 | public static new Guid IID => .("48570b85-d1ee-4fcd-a250-eb350722b037"); 12 | 13 | public struct VTable : ID3D11Resource.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Buffer* self, BufferDescription* desc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the properties of a buffer resource. 26 | * 27 | * @param description Reference to a resource description filled in by the method. 28 | */ 29 | public void GetDescription(out BufferDescription description) mut 30 | { 31 | description = ?; 32 | VT.GetDesc(&this, &description); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11CommandList.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * The ID3D11CommandList interface encapsulates a list of graphics commands for play back. 8 | */ 9 | public struct ID3D11CommandList : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => .("4f5b196e-c2bd-495e-bd01-1fded38e4969"); 12 | 13 | public struct VTable : ID3D11DeviceChild 14 | { 15 | public function [CallingConvention(.Stdcall)] UINT(ID3D11CommandList *self) GetContextFlags; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Gets the initialization flags associated with the deferred context that created the command list. 26 | * 27 | * @return The context flag is reserved for future use and is always 0. 28 | */ 29 | public UINT GetContextFlags() mut 30 | { 31 | return VT.GetContextFlags(&this); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11ComputeShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A compute-shader interface manages an executable program (a compute shader) that controls the compute-shader stage. 8 | */ 9 | public struct ID3D11ComputeShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("4f5b196e-c2bd-495e-bd01-1fded38e4969"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Counter.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * This interface encapsulates methods for measuring GPU performance. 8 | */ 9 | public struct ID3D11Counter : ID3D11Asynchronous, IComObject 10 | { 11 | public static new Guid IID => .("6e8c49fb-a371-4770-b440-29086022b741"); 12 | 13 | public struct VTable : ID3D11Asynchronous.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Counter *self, CounterDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get a counter description. 26 | * 27 | * @param desc Reference to a counter description. 28 | */ 29 | public void GetDescription(out CounterDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11DepthStencilState.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * The depth-stencil-state interface holds a description for depth-stencil state that you can bind to the output-merger stage. 8 | */ 9 | public struct ID3D11DepthStencilState : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("03823efb-8d8f-4e1c-9aa2-f64bb2cbfdf1"); 12 | 13 | public struct VTable : ID3D11DeviceChild.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11DepthStencilState* self, DepthStencilStateDescription* desc) GetDesc; 16 | }; 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Gets the description for depth-stencil state that you used to create the depth-stencil-state object. 26 | * 27 | * @param desc A reference to a DepthStencilStateDescription structure that receives a description of the depth-stencil state. 28 | */ 29 | public void GetDescription(out DepthStencilStateDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11DepthStencilView.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A depth-stencil-view interface accesses a texture resource during depth-stencil testing. 8 | */ 9 | public struct ID3D11DepthStencilView : ID3D11View, IComObject 10 | { 11 | public static new Guid IID => Guid("9fdac92a-1876-48c3-afad-25b94f84a9b6"); 12 | 13 | public struct VTable : ID3D11View.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11DepthStencilView* self, DepthStencilViewDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the depth-stencil view. 26 | * 27 | * @param desc Reference to a depth-stencil-view description. 28 | */ 29 | public void GetDescription(out DepthStencilViewDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11DomainShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A domain-shader interface manages an executable program (a domain shader) that controls the domain-shader stage. 8 | */ 9 | public struct ID3D11DomainShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("f582c508-0f36-490c-9977-31eece268cfa"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11GeometryShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A geometry-shader interface manages an executable program (a geometry shader) that controls the geometry-shader stage. 8 | */ 9 | public struct ID3D11GeometryShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("38325b96-effb-4022-ba02-2e795b70275c"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11HullShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A hull-shader interface manages an executable program (a hull shader) that controls the hull-shader stage. 8 | */ 9 | public struct ID3D11HullShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("8e5c6061-628a-4c8e-8264-bbe45cb3d5dd"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11InputLayout.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * An input-layout interface holds a definition of how to feed vertex data that is laid out in memory into the input-assembler stage of the graphics pipeline. 8 | */ 9 | public struct ID3D11InputLayout : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => .("e4819ddc-4cf0-4025-bd26-5de82a3e07b7"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11PixelShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A pixel-shader interface manages an executable program (a pixel shader) that controls the pixel-shader stage. 8 | */ 9 | public struct ID3D11PixelShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("ea82e40d-51dc-4f33-93d4-db7c9125ae8c"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Predicate.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * This interface encapsulates methods for retrieving data from the GPU asynchronously. 8 | */ 9 | public struct ID3D11Predicate : ID3D11Query, IComObject 10 | { 11 | public static new Guid IID => Guid("9eb576dd-9f77-4d86-81aa-8bab5fe490e2"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Query.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A query interface queries information from the GPU. 8 | */ 9 | public struct ID3D11Query : ID3D11Asynchronous, IComObject 10 | { 11 | public static new Guid IID => Guid("d6c00747-87b7-425e-b84d-44d108560afd"); 12 | 13 | public struct VTable : ID3D11Asynchronous.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Query *self, QueryDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get a query description. 26 | * 27 | * @param desc Referece to a query description; 28 | */ 29 | public void GetDescription(out QueryDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11RasterizerState.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * The rasterizer-state interface holds a description for rasterizer state that you can bind to the rasterizer stage. 8 | */ 9 | public struct ID3D11RasterizerState : ID3D11View, IComObject 10 | { 11 | public static new Guid IID => Guid("9bb4ab81-ab1a-4d8f-b506-fc04200b6ee7"); 12 | 13 | public struct VTable : ID3D11View.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11RasterizerState* self, RasterizerStateDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)VT; 22 | } 23 | 24 | /** 25 | * Gets the description for rasterizer state that you used to create the rasterizer-state object. 26 | * 27 | * @param desc A reference to a RasterizerStateDescription that receives a description of the rasterizer state. 28 | */ 29 | public void GetDescription(out RasterizerStateDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11RenderTargetView.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A render-target-view interface identifies the render-target subresources that can be accessed during rendering. 8 | */ 9 | public struct ID3D11RenderTargetView : ID3D11View, IComObject 10 | { 11 | public static new Guid IID => Guid("dfdba067-0b8d-4865-875b-d7b4516cc164"); 12 | 13 | public struct VTable : ID3D11View.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11RenderTargetView* self, RenderTargetViewDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the properties of a render target view. 26 | * 27 | * @param desc Reference to the description of a render target view. 28 | */ 29 | public void GetDescription(out RenderTargetViewDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Resource.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.DXGI; 3 | using DirectX.Common; 4 | 5 | namespace DirectX.D3D11 6 | { 7 | /** 8 | * A resource interface provides common actions on all resources. 9 | */ 10 | public struct ID3D11Resource : ID3D11DeviceChild, IComObject 11 | { 12 | public static new Guid IID => Guid("dc8e63f3-d12b-4952-b47b-5e45026a862d"); 13 | 14 | public struct VTable : ID3D11DeviceChild.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] void(ID3D11Resource* self, ResourceDimension* pResourceDimension) GetResourceType; 17 | public function [CallingConvention(.Stdcall)] void(ID3D11Resource* self, ResourcePriority evictionPriority) SetEvictionPriority; 18 | public function [CallingConvention(.Stdcall)] ResourcePriority(ID3D11Resource* self) GetEvictionPriority; 19 | } 20 | 21 | public new VTable* VT 22 | { 23 | [Inline] 24 | get => (.)mVT; 25 | } 26 | 27 | /** 28 | * Get the type of the resource. 29 | * 30 | * @return The resource dimension 31 | */ 32 | public ResourceDimension GetResourceType() mut 33 | { 34 | ResourceDimension dim = ?; 35 | VT.GetResourceType(&this, &dim); 36 | return dim; 37 | } 38 | 39 | /** 40 | * Set the eviction priority of a resource. 41 | * 42 | * @param evictionPriority The eviction priority for this resource. 43 | */ 44 | public void SetEvictionPriority(ResourcePriority evictionPriority) mut 45 | { 46 | VT.SetEvictionPriority(&this, evictionPriority); 47 | } 48 | 49 | /** 50 | * Get the eviction priority of a resource. 51 | * 52 | * @return The eviction priority of this resource. 53 | */ 54 | public ResourcePriority GetEvictionPriority() mut 55 | { 56 | return VT.GetEvictionPriority(&this); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11SamplerState.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * The sampler-state interface holds a description for sampler state that you can bind to any shader stage of the pipeline for reference by texture sample operations. 8 | */ 9 | public struct ID3D11SamplerState : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => .("da6fea51-564c-4487-9810-f0d0f9b4e3a5"); 12 | 13 | public struct VTable : ID3D11DeviceChild.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11SamplerState* seld, SamplerStateDescription* pDesc)GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Gets the description for sampler state that you used to create the sampler-state object. 26 | * 27 | * @param desc A reference to a SamplerStateDescription that receives a description of the sampler state. 28 | */ 29 | public void GetDescription(out SamplerStateDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11ShaderResourceView.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A shader-resource-view interface specifies the subresources a shader can access during rendering. 8 | * Examples of shader resources include a constant buffer, a texture buffer, and a texture. 9 | */ 10 | public struct ID3D11ShaderResourceView : ID3D11View, IComObject 11 | { 12 | public static new Guid IID => .("b0e06fe0-8192-4e1a-b1ca-36d7414710b2"); 13 | 14 | public struct VTable : ID3D11View.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] void(ID3D11ShaderResourceView* self, ShaderResourceViewDescription* pDesc) GetDesc; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Get the shader resource view's description. 27 | * 28 | * @param desc A reference to a ShaderResourceViewDescription to be filled with data about the shader resource view. 29 | */ 30 | public void GetDescription(out ShaderResourceViewDescription desc) mut 31 | { 32 | desc = ?; 33 | VT.GetDesc(&this, &desc); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Texture1D.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A 1D texture interface accesses texel data, which is structured memory. 8 | */ 9 | public struct ID3D11Texture1D : ID3D11Resource, IComObject 10 | { 11 | public static new Guid IID => .("f8fb5c27-c6b3-4f75-a4c8-439af2ef564c"); 12 | 13 | public struct VTable : ID3D11Resource.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Texture1D* self, Texture1DDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the properties of the texture resource. 26 | * 27 | * @param desc A reference to the structure that receives the description. 28 | */ 29 | public void GetDescription(out Texture1DDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Texture2D.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A 2D texture interface manages texel data, which is structured memory. 8 | */ 9 | public struct ID3D11Texture2D : ID3D11Resource, IComObject 10 | { 11 | public static new Guid IID => .("6f15aaf2-d208-4e89-9ab4-489535d34f9c"); 12 | 13 | public struct VTable : ID3D11Resource.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Texture2D* self, Texture2DDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the properties of the texture resource. 26 | * 27 | * @param desc A reference to the structure that receives the description. 28 | */ 29 | public void GetDescription(out Texture2DDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11Texture3D.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A 3D texture interface accesses texel data, which is structured memory. 8 | */ 9 | public struct ID3D11Texture3D : ID3D11Resource, IComObject 10 | { 11 | public static new Guid IID => .("037e866e-f56d-4357-a8af-9dabbe6e250e"); 12 | 13 | public struct VTable : ID3D11Resource.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11Texture3D* self, Texture3DDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the properties of the texture resource. 26 | * 27 | * @param desc A reference to the structure that receives the description. 28 | */ 29 | public void GetDescription(out Texture3DDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11UnorderedAccessView.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A view interface specifies the parts of a resource the pipeline can access during rendering. 8 | */ 9 | public struct ID3D11UnorderedAccessView : ID3D11View, IComObject 10 | { 11 | public static new Guid IID => Guid("28acf509-7f5c-48f6-8611-f316010a6380"); 12 | 13 | public struct VTable : ID3D11View.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11UnorderedAccessView* self, UnorderedAccessViewDescription *pDesc) GetDesc; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get a description of the resource. 26 | * 27 | * @param desc A reference to the structure describing the resource. 28 | */ 29 | public void GetDescription(out UnorderedAccessViewDescription desc) mut 30 | { 31 | desc = ?; 32 | VT.GetDesc(&this, &desc); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11VertexShader.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A vertex-shader interface manages an executable program (a vertex shader) that controls the vertex-shader stage. 8 | */ 9 | public struct ID3D11VertexShader : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => Guid("3b301d64-d678-4289-8897-22f8928b72f3"); 12 | 13 | // This interface doesn't implement any new methods. 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ID3D11View.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11 5 | { 6 | /** 7 | * A view interface specifies the parts of a resource the pipeline can access during rendering. 8 | */ 9 | public struct ID3D11View : ID3D11DeviceChild, IComObject 10 | { 11 | public static new Guid IID => .("839d1216-bb2e-412b-b7f4-a9dbebe08ed1"); 12 | 13 | public struct VTable : ID3D11DeviceChild.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] void(ID3D11View* self, ID3D11Resource **ppResource) GetResource; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Get the resource that is accessed through this view. 26 | * 27 | * @param resource Reference to a pointer to the resource that is accessed through this view. 28 | */ 29 | public void GetResource(out ID3D11Resource* resource) mut 30 | { 31 | resource = ?; 32 | VT.GetResource(&this, &resource); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/InputClassification.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Type of data contained in an input slot. 5 | D3D11_INPUT_CLASSIFICATION 6 | */ 7 | public enum InputClassification : uint32 8 | { 9 | /** 10 | Input data is per-vertex data. 11 | D3D11_INPUT_PER_VERTEX_DATA 12 | */ 13 | PerVertexData = 0, 14 | /** 15 | Input data is per-instance data. 16 | D3D11_INPUT_PER_INSTANCE_DATA 17 | */ 18 | PerInstanceData = 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/MapFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Specifies how the CPU should respond when an application calls the ID3D11DeviceContext::Map method on a resource that is being used by the GPU. 5 | */ 6 | public enum MapFlags : uint32 7 | { 8 | /** 9 | Specifies that ID3D11DeviceContext::Map should return DXGI_ERROR_WAS_STILL_DRAWING when the GPU blocks the CPU from accessing a resource. 10 | D3D11_MAP_FLAG_DO_NOT_WAIT 11 | */ 12 | DoNotWait = 0x100000L, 13 | /** 14 | No mapflags specified 15 | */ 16 | None = 0, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/MapType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Identifies a resource to be accessed for reading and writing by the CPU. Applications may combine one or more of these flags. 5 | D3D11_MAP 6 | */ 7 | public enum MapType : uint32 8 | { 9 | /** 10 | Resource is mapped for reading. 11 | The resource must have been created with read access. 12 | D3D11_MAP_READ 13 | */ 14 | Read = 1, 15 | /** 16 | Resource is mapped for writing. 17 | The resource must have been created with write access. 18 | D3D11_MAP_WRITE 19 | */ 20 | Write = 2, 21 | /** 22 | Resource is mapped for reading and writing. 23 | The resource must have been created with read and write access. 24 | access. 25 | D3D11_MAP_READ_WRITE 26 | */ 27 | ReadWrite = 3, 28 | /** 29 | Resource is mapped for writing; the previous contents of the resource will be undefined. 30 | The resource must have been created with write access and dynamic usage. 31 | D3D11_MAP_WRITE_DISCARD 32 | */ 33 | WriteDiscard = 4, 34 | /** 35 | Resource is mapped for writing; the existing contents of the resource cannot be overwritten. 36 | This flag is only valid on vertex and index buffers. 37 | The resource must have been created with write access. 38 | Cannot be used on a resource created with the D3D11_BIND_CONSTANT_BUFFER flag. 39 | D3D11_MAP_WRITE_NO_OVERWRITE 40 | */ 41 | WriteNoOverwrite = 5 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/MappedSubresource.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | Provides access to subresource data. 7 | D3D11_MAPPED_SUBRESOURCE 8 | */ 9 | [CRepr] 10 | public struct MappedSubresource 11 | { 12 | /** 13 | Pointer to the data. 14 | */ 15 | public void* Data; 16 | /** 17 | The row pitch, or width, or physical size (in bytes) of the data. 18 | */ 19 | public uint32 RowPitch; 20 | /** 21 | The depth pitch, or width, or physical size (in bytes)of the data. 22 | */ 23 | public uint32 DepthPitch; 24 | } 25 | 26 | /* 27 | Todo: Generic MappedSubresource 28 | /** 29 | Provides access to subresource data. 30 | D3D11_MAPPED_SUBRESOURCE 31 | */ 32 | [CRepr] 33 | public struct MappedSubresource where T: struct 34 | { 35 | /** 36 | Pointer to the data. 37 | */ 38 | public T* Data; 39 | /** 40 | The row pitch, or width, or physical size (in bytes) of the data. 41 | */ 42 | public uint32 RowPitch; 43 | /** 44 | The depth pitch, or width, or physical size (in bytes)of the data. 45 | */ 46 | public uint32 DepthPitch; 47 | }*/ 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/QueryDataTimestampDisjoint.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Query information about the reliability of a timestamp query. 5 | * @native D3D11_QUERY_DATA_TIMESTAMP_DISJOINT 6 | */ 7 | public struct QueryDataTimestampDisjoint 8 | { 9 | /** 10 | * How frequently the GPU counter increments in Hz. 11 | */ 12 | public uint64 Frequency; 13 | /** 14 | * If this is TRUE, something occurred in between the query's ID3D11DeviceContext::Begin and ID3D11DeviceContext::End calls that caused the timestamp counter to become discontinuous or disjoint. 15 | */ 16 | public BOOL Disjoint; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/QueryDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** Describes a query. */ 6 | [CRepr] 7 | public struct QueryDescription 8 | { 9 | /// Type of query. 10 | public Query Query; 11 | /// Miscellaneous flags. 12 | public QueryMiscFlags MiscFlags; 13 | 14 | /** 15 | * Instantiates a new instance of an uninitialized QueryDescription structure. 16 | */ 17 | public this() 18 | { 19 | this =default; 20 | } 21 | 22 | /** 23 | * Instantiates a new instance of a QueryDescription structure that is initialized with info for a query. 24 | * @param query A Query-typed value that specifies the type of query. 25 | * @param miscFlags A combination of QueryMiscFlags-typed values that are combined by using a bitwise OR operation. 26 | * The resulting value specifies miscellaneous query behavior. 27 | */ 28 | public this(Query query, QueryMiscFlags miscFlags = .None) 29 | { 30 | Query = query; 31 | MiscFlags = miscFlags; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/QueryMiscFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** Flags that describe miscellaneous query behavior. */ 4 | public enum QueryMiscFlags : UINT 5 | { 6 | /** 7 | No query misc flags 8 | */ 9 | None = 0, 10 | /** 11 | * Tell the hardware that if it is not yet sure if something is hidden or not to draw it anyway. 12 | * This is only used with an occlusion predicate. 13 | * Predication data cannot be returned to your application via ID3D11DeviceContext::GetData when using this flag. 14 | * D3D11_QUERY_MISC_PREDICATEHINT 15 | */ 16 | PredicateHint = 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/RaiseFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | public enum RaiseFlags : uint32 //D3D11_RAISE_FLAG 4 | { 5 | DriverInternalError = 0x1L, // D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR 6 | None = 0 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/RenderTargetViewDimension.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | These flags identify the type of resource that will be viewed as a render target. 5 | D3D11_RTV_DIMENSION 6 | // Todo: Rename 7 | */ 8 | enum RenderTargetViewDimension : uint32 9 | { 10 | /** 11 | Do not use this value, as it will cause ID3D11Device::CreateRenderTargetView to fail. 12 | D3D11_RTV_DIMENSION_UNKNOWN 13 | */ 14 | Unknown = 0, 15 | /** 16 | The resource will be accessed as a buffer. 17 | D3D11_RTV_DIMENSION_BUFFER 18 | */ 19 | Buffer = 1, 20 | /** 21 | The resource will be accessed as a 1D texture. 22 | D3D11_RTV_DIMENSION_TEXTURE1D 23 | */ 24 | Texture1D = 2, 25 | /** 26 | The resource will be accessed as an array of 1D textures. 27 | D3D11_RTV_DIMENSION_TEXTURE1DARRAY 28 | */ 29 | Texture1DArray = 3, 30 | /** 31 | The resource will be accessed as a 2D texture. 32 | D3D11_RTV_DIMENSION_TEXTURE2D 33 | */ 34 | Texture2D = 4, 35 | /** 36 | The resource will be accessed as an array of 2D textures. 37 | D3D11_RTV_DIMENSION_TEXTURE2DARRAY 38 | */ 39 | Texture2DArray = 5, 40 | /** 41 | The resource will be accessed as a 2D texture with multisampling. 42 | D3D11_RTV_DIMENSION_TEXTURE2DMS 43 | */ 44 | Texture2DMultisample = 6, 45 | /** 46 | The resource will be accessed as an array of 2D textures with multisampling. 47 | D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY 48 | */ 49 | Texture2DArrayMultisample = 7, 50 | /** 51 | The resource will be accessed as a 3D texture. 52 | D3D11_RTV_DIMENSION_TEXTURE3D 53 | */ 54 | Texture3D = 8 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ResourceDimension.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | D3D11_RESOURCE_DIMENSION: 5 | Identifies the type of resource being used. 6 | */ 7 | public enum ResourceDimension : uint32 8 | { 9 | /** 10 | D3D11_RESOURCE_DIMENSION_UNKNOWN: 11 | Resource is of unknown type. 12 | */ 13 | Unknown = 0, 14 | /** 15 | D3D11_RESOURCE_DIMENSION_BUFFER: 16 | Resource is a buffer. 17 | */ 18 | Buffer = 1, 19 | /** 20 | D3D11_RESOURCE_DIMENSION_TEXTURE1D: 21 | Resource is a 1D texture. 22 | */ 23 | Texture1D = 2, 24 | /** 25 | D3D11_RESOURCE_DIMENSION_TEXTURE2D: 26 | Resource is a 2D texture. 27 | */ 28 | Texture2D = 3, 29 | /** 30 | D3D11_RESOURCE_DIMENSION_TEXTURE3D: 31 | Resource is a 3D texture. 32 | */ 33 | Texture3D = 4 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/InfoQueueFilter.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11.SDKLayers 4 | { 5 | [CRepr] 6 | public struct InfoQueueFilter 7 | { 8 | public InfoQueueFilterDescription AllowList; 9 | public InfoQueueFilterDescription DenyList; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/InfoQueueFilterDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11.SDKLayers 4 | { 5 | [CRepr] 6 | public struct InfoQueueFilterDescription 7 | { 8 | public uint32 NumCategories; 9 | public MessageCategory* CategoryList; 10 | public uint32 NumSeverities; 11 | public MessageSeverity* SeverityList; 12 | public uint32 NumIDs; 13 | public MessageID* IDList; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/Message.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11.SDKLayers 4 | { 5 | [CRepr] 6 | public struct Message 7 | { 8 | public MessageCategory Category; 9 | public MessageSeverity Severity; 10 | public MessageID ID; 11 | public char8* pDescription; 12 | public uint32 DescriptionByteLength; // SIZE_T 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/MessageCategory.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11.SDKLayers 2 | { 3 | /** 4 | Categories of debug messages. 5 | This will identify the category of a message when retrieving a message with ID3D11InfoQueue::GetMessage and when adding a message with ID3D11InfoQueue::AddMessage. 6 | When creating an info queue filter, these values can be used to allow or deny any categories of messages to pass through the storage and retrieval filters. 7 | D3D11_MESSAGE_CATEGORY 8 | */ 9 | public enum MessageCategory : uint32 10 | { 11 | /** 12 | User defined message. See ID3D11InfoQueue.AddMessage. 13 | D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED 14 | */ 15 | ApplicationDefined = 0, 16 | /** 17 | D3D11_MESSAGE_CATEGORY_MISCELLANEOUS 18 | */ 19 | Miscellaneous = (ApplicationDefined + 1), 20 | /** 21 | D3D11_MESSAGE_CATEGORY_INITIALIZATION 22 | */ 23 | Initialization = (Miscellaneous + 1), 24 | /** 25 | D3D11_MESSAGE_CATEGORY_CLEANUP 26 | */ 27 | Cleanup = (Initialization + 1), 28 | /** 29 | D3D11_MESSAGE_CATEGORY_COMPILATION 30 | */ 31 | Compilation = (Cleanup + 1), 32 | /** 33 | D3D11_MESSAGE_CATEGORY_STATE_CREATION 34 | */ 35 | StateCreation = (Compilation + 1), 36 | /** 37 | D3D11_MESSAGE_CATEGORY_STATE_SETTING 38 | */ 39 | StateSetting = (StateCreation + 1), 40 | /** 41 | D3D11_MESSAGE_CATEGORY_STATE_GETTING 42 | */ 43 | StateGetting = (StateSetting + 1), 44 | /** 45 | D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION 46 | */ 47 | ResourceManipulation = (StateGetting + 1), 48 | /** 49 | D3D11_MESSAGE_CATEGORY_EXECUTION 50 | */ 51 | Execution = (ResourceManipulation + 1), 52 | /** 53 | Direct3D 11: This value is not supported until Direct3D 11.1. 54 | D3D11_MESSAGE_CATEGORY_SHADER 55 | */ 56 | Shader = (Execution + 1) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/MessageSeverity.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11.SDKLayers 2 | { 3 | /** 4 | D3D11_MESSAGE_SEVERITY 5 | */ 6 | public enum MessageSeverity : uint32 7 | { 8 | /** 9 | Defines some type of corruption which has occurred. 10 | D3D11_MESSAGE_SEVERITY_CORRUPTION 11 | */ 12 | Corruption = 0, 13 | /** 14 | Defines an error message. 15 | D3D11_MESSAGE_SEVERITY_ERROR 16 | */ 17 | Error = (Corruption + 1), 18 | /** 19 | Defines a warning message. 20 | D3D11_MESSAGE_SEVERITY_WARNING 21 | */ 22 | Warning = (Error + 1), 23 | /** 24 | Defines an information message. 25 | D3D11_MESSAGE_SEVERITY_INFO 26 | */ 27 | Info = (Warning + 1), 28 | /** 29 | Defines a message other than corruption, error, warning, or information. 30 | Direct3D 11: This value is not supported until Direct3D 11.1. 31 | D3D11_MESSAGE_SEVERITY_MESSAGE 32 | */ 33 | Message = (Info + 1) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SDKLayers/ReportLiveDeviceObjectFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11.SDKLayers 2 | { 3 | /** 4 | Options for the amount of information to report about a device object's lifetime. 5 | D3D11_RLDO_FLAGS 6 | */ 7 | public enum ReportLiveDeviceObjectFlags : uint32 8 | { 9 | /** 10 | Specifies to obtain a summary about a device object's lifetime. 11 | D3D11_RLDO_SUMMARY 12 | */ 13 | Summary = 0x1, 14 | /** 15 | Specifies to obtain detailed information about a device object's lifetime. 16 | D3D11_RLDO_DETAIL 17 | */ 18 | Detail = 0x2, 19 | /** 20 | This flag indicates to ignore objects which have no external refcounts keeping them alive. 21 | D3D objects are printed using an external refcount and an internal refcount. Typically, all objects are printed. 22 | This flag means ignore the objects whose external refcount is 0, because the application is not responsible for keeping them alive. 23 | D3D11_RLDO_IGNORE_INTERNAL 24 | */ 25 | IgnoreInternal = 0x4 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/ShaderMinimumPrecision.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Values that specify minimum precision levels at shader stages. 5 | */ 6 | public enum ShaderMinimumPrecision : uint32 7 | { 8 | /** 9 | * Indicates that the device only supports 32-bit precision. 10 | */ 11 | Precision32BitOny = 0x0, 12 | /** 13 | * Minimum precision level is 10-bit. 14 | * D3D11_SHADER_MIN_PRECISION_10_BIT 15 | */ 16 | Precision10Bit = 0x1, 17 | /** 18 | * Minimum precision level is 16-bit. 19 | * D3D11_SHADER_MIN_PRECISION_16_BIT 20 | */ 21 | Precision16Bit = 0x2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SharedResourceTier.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Defines constants that specify a tier for shared resource support. 5 | */ 6 | public enum SharedResourceTier : uint32 7 | { 8 | /** 9 | * Specifies the support available when D3D11_FEATURE_DATA_D3D11_OPTIONS::ExtendedResourceSharing is FALSE. 10 | */ 11 | Tier0 = 0, 12 | /** 13 | * Specifies the support available when D3D11_FEATURE_DATA_D3D11_OPTIONS::ExtendedResourceSharing is TRUE. 14 | */ 15 | Tier1 = 1, 16 | /** 17 | * Specifies the support available when D3D11_FEATURE_DATA_D3D11_OPTIONS4::ExtendedNV12SharedTextureSupported is TRUE. Also see Extended NV12 texture support. 18 | */ 19 | Tier2 = 2, 20 | /** 21 | * Specifies that DXGI_FORMAT_R11G11B10_FLOAT supports NT handle sharing. Also see CreateSharedHandle. 22 | */ 23 | Tier3 = 3 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/StencilOperation.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | The stencil operations that can be performed during depth-stencil testing. 5 | D3D11_STENCIL_OP 6 | */ 7 | public enum StencilOperation : uint32 8 | { 9 | /** 10 | Keep the existing stencil data. 11 | D3D11_STENCIL_OP_KEEP 12 | */ 13 | Keep = 1, 14 | /** 15 | Set the stencil data to 0. 16 | D3D11_STENCIL_OP_ZERO 17 | */ 18 | Zero= 2, 19 | /** 20 | Set the stencil data to the reference value set by calling ID3D11DeviceContext::OMSetDepthStencilState. 21 | D3D11_STENCIL_OP_REPLACE 22 | */ 23 | Replace = 3, 24 | /** 25 | Increment the stencil value by 1, and clamp the result. 26 | D3D11_STENCIL_OP_INCR_SAT 27 | */ 28 | IncrementAndClamp = 4, 29 | /** 30 | Decrement the stencil value by 1, and clamp the result. 31 | D3D11_STENCIL_OP_DECR_SAT 32 | */ 33 | DecrementAndClamp = 5, 34 | /** 35 | Invert the stencil data. 36 | D3D11_STENCIL_OP_INVERT 37 | */ 38 | Invert = 6, 39 | /** 40 | Increment the stencil value by 1, and wrap the result if necessary. 41 | D3D11_STENCIL_OP_INCR 42 | */ 43 | Increment = 7, 44 | /** 45 | Decrement the stencil value by 1, and wrap the result if necessary. 46 | D3D11_STENCIL_OP_DECR 47 | */ 48 | Decrement = 8 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/StreamOutputDeclarationEntry.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Description of a vertex element in a vertex buffer in an output slot. 7 | */ 8 | [CRepr] 9 | public struct StreamOutputDeclarationEntry 10 | { 11 | /** 12 | * Zero-based, stream number. 13 | */ 14 | public UINT Stream; 15 | /** 16 | * Type of output element; possible values include: "POSITION", "NORMAL", or "TEXCOORD0". 17 | * Note that if SemanticName is NULL then ComponentCount can be greater than 4 and the described entry will be a gap in the stream out where no data will be written. 18 | */ 19 | public char8* SemanticName; 20 | /** 21 | * Output element's zero-based index. Should be used if, for example, you have more than one texture coordinate stored in each vertex. 22 | */ 23 | public UINT SemanticIndex; 24 | /** 25 | * Which component of the entry to begin writing out to. Valid values are 0 to 3. 26 | * For example, if you only wish to output to the y and z components of a position, then StartComponent should be 1 and ComponentCount should be 2. 27 | */ 28 | public uint8 StartComponent; 29 | /** 30 | * The number of components of the entry to write out to. Valid values are 1 to 4. 31 | * For example, if you only wish to output to the y and z components of a position, then StartComponent should be 1 and ComponentCount should be 2. 32 | * Note that if SemanticName is NULL then ComponentCount can be greater than 4 and the described entry will be a gap in the stream out where no data will be written. 33 | */ 34 | public uint8 ComponentCount; 35 | /** 36 | * The associated stream output buffer that is bound to the pipeline (see ID3D11DeviceContext::SOSetTargets). 37 | * The valid range for OutputSlot is 0 to 3. 38 | */ 39 | public uint8 OutputSlot; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/SubresourceData.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3D11 4 | { 5 | /** 6 | * Specifies data for initializing a subresource. 7 | * D3D11_SUBRESOURCE_DATA 8 | */ 9 | [CRepr] 10 | public struct SubresourceData 11 | { 12 | /** 13 | * Pointer to the initialization data. 14 | */ 15 | public void* Data; 16 | /** 17 | * The distance (in bytes) from the beginning of one line of a texture to the next line. 18 | * System-memory pitch is used only for 2D and 3D texture data as it is has no meaning for the other resource types. 19 | */ 20 | public uint32 LinePitch; 21 | /** 22 | * The distance (in bytes) from the beginning of one depth level to the next. 23 | * System-memory-slice pitch is only used for 3D texture data as it has no meaning for the other resource types. 24 | */ 25 | public uint32 SlicePitch; 26 | 27 | public this() 28 | { 29 | this = default; 30 | } 31 | 32 | public this(void* data) : this(data, 0, 0) {} 33 | 34 | public this(void* data, uint32 linePitch, uint32 slicePitch) 35 | { 36 | Data = data; 37 | LinePitch = linePitch; 38 | SlicePitch = slicePitch; 39 | } 40 | } 41 | 42 | /** 43 | * Specifies data for initializing a subresource. 44 | * D3D11_SUBRESOURCE_DATA 45 | */ 46 | [CRepr] 47 | public struct SubresourceData where T : struct 48 | { 49 | /** 50 | * Pointer to the initialization data. 51 | */ 52 | public T* Data; 53 | /** 54 | * The distance (in bytes) from the beginning of one line of a texture to the next line. 55 | * System-memory pitch is used only for 2D and 3D texture data as it is has no meaning for the other resource types. 56 | */ 57 | public uint32 LinePitch; 58 | /** 59 | * The distance (in bytes) from the beginning of one depth level to the next. 60 | * System-memory-slice pitch is only used for 3D texture data as it has no meaning for the other resource types. 61 | */ 62 | public uint32 SlicePitch; 63 | 64 | public this() 65 | { 66 | this = default; 67 | } 68 | 69 | public this(T* data, uint32 linePitch, uint32 slicePitch) 70 | { 71 | Data = data; 72 | LinePitch = linePitch; 73 | SlicePitch = slicePitch; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/TextureAddressMode.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Identify a technique for resolving texture coordinates that are outside of the boundaries of a texture. 5 | D3D11_TEXTURE_ADDRESS_MODE 6 | */ 7 | public enum TextureAddressMode : uint32 8 | { 9 | /** 10 | Tile the texture at every (u,v) integer junction. For example, for u values between 0 and 3, the texture is repeated three times. 11 | D3D11_TEXTURE_ADDRESS_WRAP 12 | */ 13 | Wrap = 1, 14 | /** 15 | Flip the texture at every (u,v) integer junction. For u values between 0 and 1, for example, the texture is addressed normally; 16 | between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on. 17 | D3D11_TEXTURE_ADDRESS_MIRROR 18 | */ 19 | Mirror = 2, 20 | /** 21 | Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively. 22 | D3D11_TEXTURE_ADDRESS_CLAMP 23 | */ 24 | Clamp = 3, 25 | /** 26 | Texture coordinates outside the range [0.0, 1.0] are set to the border color specified in D3D11_SAMPLER_DESC or HLSL code. 27 | D3D11_TEXTURE_ADDRESS_BORDER 28 | */ 29 | Border = 4, 30 | /** 31 | Similar to D3D11_TEXTURE_ADDRESS_MIRROR and D3D11_TEXTURE_ADDRESS_CLAMP. 32 | Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then clamps to the maximum value. 33 | D3D11_TEXTURE_ADDRESS_MIRROR_ONCE 34 | */ 35 | MirrorOnce = 5 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/TextureCubeFace.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * The different faces of a cube texture. 5 | * D3D11_TEXTURECUBE_FACE 6 | */ 7 | public enum TextureCubeFace : uint32 8 | { 9 | /// Positive X face. 10 | PositiveX = 0, 11 | /// Negative X face. 12 | NegativeX = 1, 13 | /// Positive Y face. 14 | PositiveY = 2, 15 | /// Negative Y face. 16 | NegativeY = 3, 17 | /// Positive Z face. 18 | PositiveZ = 4, 19 | /// Negative Z face. 20 | NegativeZ = 5, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/TiledResourceTier.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Indicates the tier level at which tiled resources are supported. 5 | */ 6 | public enum TiledResourceTier 7 | { 8 | /** 9 | * Tiled resources are not supported. 10 | * D3D11_TILED_RESOURCES_NOT_SUPPORTED 11 | */ 12 | NotSupported = 0, 13 | /** 14 | * Tier_1 tiled resources are supported. 15 | * D3D11_TILED_RESOURCES_TIER_1 16 | */ 17 | Tier1 = 1, 18 | /** 19 | * Tier_2 tiled resources are supported. 20 | * D3D11_TILED_RESOURCES_TIER_2 21 | */ 22 | Tier2 = 2, 23 | /** 24 | * Tier_3 tiled resources are supported. 25 | * D3D11_TILED_RESOURCES_TIER_3 26 | */ 27 | Tier3 = 3 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/UnorderedAccessViewDimension.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | * Unordered-access view options. 5 | */ 6 | public enum UnorderedAccessViewDimension : uint32 7 | { 8 | /** 9 | * The view type is unknown. 10 | * D3D11_UAV_DIMENSION_UNKNOWN 11 | */ 12 | Unknown = 0, 13 | /** 14 | * View the resource as a buffer. 15 | * D3D11_UAV_DIMENSION_BUFFER 16 | */ 17 | Buffer = 1, 18 | /** 19 | * View the resource as a 1D texture. 20 | * D3D11_UAV_DIMENSION_TEXTURE1D 21 | */ 22 | Texture1D = 2, 23 | /** 24 | * View the resource as a 1D texture array. 25 | * D3D11_UAV_DIMENSION_TEXTURE1DARRAY 26 | */ 27 | Texture1DArray = 3, 28 | /** 29 | * View the resource as a 2D texture. 30 | * D3D11_UAV_DIMENSION_TEXTURE2D 31 | */ 32 | Texture2D = 4, 33 | /** 34 | * View the resource as a 2D texture array. 35 | * D3D11_UAV_DIMENSION_TEXTURE2DARRAY 36 | */ 37 | Texture2DArray = 5, 38 | /** 39 | * View the resource as a 3D texture array. 40 | * D3D11_UAV_DIMENSION_TEXTURE3D 41 | */ 42 | Texture3D = 8 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DirectX/src/D3D11/Usage.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11 2 | { 3 | /** 4 | Identifies expected resource use during rendering. 5 | The usage directly reflects whether a resource is accessible by the CPU and/or the graphics processing unit (GPU). 6 | D3D11_USAGE 7 | */ 8 | public enum Usage : uint32 9 | { 10 | /** 11 | A resource that requires read and write access by the GPU. This is likely to be the most common usage choice. 12 | D3D11_USAGE_DEFAULT 13 | */ 14 | Default = 0, 15 | /** 16 | A resource that can only be read by the GPU. It cannot be written by the GPU, and cannot be accessed at all by the CPU. 17 | This type of resource must be initialized when it is created, since it cannot be changed after creation. 18 | D3D11_USAGE_IMMUTABLE 19 | */ 20 | Immutable = 1, 21 | /** 22 | A resource that is accessible by both the GPU (read only) and the CPU (write only). 23 | A dynamic resource is a good choice for a resource that will be updated by the CPU at least once per frame. 24 | To update a dynamic resource, use a Map method. 25 | D3D11_USAGE_DYNAMIC 26 | */ 27 | Dynamic = 2, 28 | /** 29 | A resource that supports data transfer (copy) from the GPU to the CPU. 30 | D3D11_USAGE_STAGING 31 | */ 32 | Staging = 3 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/D3D11Shader.bf: -------------------------------------------------------------------------------- 1 | using DirectX.Common; 2 | 3 | namespace DirectX.D3D11Shader 4 | { 5 | static 6 | { 7 | // Slot ID for library function return 8 | public const int32 D3D_RETURN_PARAMETER_INDEX = -1; 9 | 10 | public const uint32 D3D_SHADER_REQUIRES_DOUBLES = 0x00000001; 11 | public const uint32 D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL = 0x00000002; 12 | public const uint32 D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE = 0x00000004; 13 | public const uint32 D3D_SHADER_REQUIRES_64_UAVS = 0x00000008; 14 | public const uint32 D3D_SHADER_REQUIRES_MINIMUM_PRECISION = 0x00000010; 15 | public const uint32 D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS = 0x00000020; 16 | public const uint32 D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS = 0x00000040; 17 | public const uint32 D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING = 0x00000080; 18 | public const uint32 D3D_SHADER_REQUIRES_TILED_RESOURCES = 0x00000100; 19 | } 20 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ID3D11FunctionParameterReflection.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * A function-parameter-reflection interface accesses function-parameter info. 8 | */ 9 | public struct ID3D11FunctionParameterReflection : IInterfaceID 10 | { 11 | public static Guid IID => .(0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62); 12 | 13 | public struct VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(ID3D11FunctionParameterReflection* self, ParameterDescription *pDesc) GetDesc; 16 | } 17 | 18 | protected VTable _vt; 19 | 20 | public VTable VT => _vt; 21 | 22 | /** 23 | * Fills the parameter descriptor structure for the function's parameter. 24 | * 25 | * @param desc A reference to a ParameterDescription structure that receives a description of the function's parameter. 26 | */ 27 | public HResult GetDescription(out ParameterDescription desc) mut 28 | { 29 | desc = ?; 30 | return _vt.GetDesc(&this, &desc); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ID3D11LibraryReflection.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * A library-reflection interface accesses library info. 8 | */ 9 | public struct ID3D11LibraryReflection : IUnknown, IComObject 10 | { 11 | public static new Guid IID => .(0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x1, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6); 12 | 13 | public struct VTable : IUnknown.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(ID3D11LibraryReflection* self, LibraryDescription *pDesc) GetDesc; 16 | 17 | public function [CallingConvention(.Stdcall)] ID3D11FunctionReflection*(ID3D11LibraryReflection* self, int32 functionIndex) GetFunctionByIndex; 18 | } 19 | 20 | public new VTable* VT 21 | { 22 | [Inline] 23 | get => (.)mVT; 24 | } 25 | 26 | /** 27 | * Fills the library descriptor structure for the library reflection. 28 | * 29 | * @param desc A reference to a LibraryDescription structure that receives a description of the library reflection. 30 | */ 31 | public HResult GetDescription(out LibraryDescription desc) mut 32 | { 33 | desc = ?; 34 | return VT.GetDesc(&this, &desc); 35 | } 36 | 37 | /** 38 | * Gets the function reflector. 39 | * 40 | * @param index The zero-based index of the function reflector to retrieve. 41 | * @return A pointer to a ID3D11FunctionReflection interface that represents the function reflector. 42 | */ 43 | public ID3D11FunctionReflection* GetFunctionByIndex(int32 index) mut 44 | { 45 | return VT.GetFunctionByIndex(&this, index); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ID3D11LinkingNode.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | 5 | namespace DirectX.D3D11Shader 6 | { 7 | /** 8 | * A linking-node interface is used for shader linking. 9 | */ 10 | public struct ID3D11LinkingNode : IUnknown, IComObject 11 | { 12 | public static new Guid IID => .(0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x3, 0xc7, 0x9b, 0x35, 0x56, 0xdb); 13 | 14 | // This interface adds no new methods. 15 | } 16 | } -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ID3D11Module.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * A module interface creates an instance of a module that is used for resource rebinding. 8 | */ 9 | public struct ID3D11Module : IUnknown, IComObject 10 | { 11 | public static new Guid IID => .(0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34); 12 | 13 | public struct VTable : IUnknown.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(ID3D11Module* self, char8* pNamespace, ID3D11ModuleInstance** ppModuleInstance) CreateInstance; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Initializes an instance of a shader module that is used for resource rebinding. 26 | * 27 | * @param pNamespace The name of a shader module to initialize. 28 | * This can be NULL if you don't want to specify a name for the module. 29 | * @param moduleInstance The address of a pointer to an ID3D11ModuleInstance interface to initialize. 30 | */ 31 | public HResult CreateInstance(char8* pNamespace, ID3D11ModuleInstance** moduleInstance) mut 32 | { 33 | return VT.CreateInstance(&this, pNamespace, moduleInstance); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/LibraryDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.D3DCompiler; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a library. 8 | * D3D11_LIBRARY_DESC 9 | */ 10 | [CRepr] 11 | public struct LibraryDescription 12 | { 13 | /** 14 | * The name of the originator of the library. 15 | */ 16 | public char8* Creator; 17 | /** 18 | * A combination of ShaderCompileFlags that are combined by using a bitwise OR operation. 19 | * The resulting value specifies how the compiler compiles. 20 | */ 21 | public ShaderCompileFlags Flags; 22 | /** 23 | * The number of functions exported from the library. 24 | */ 25 | public uint32 FunctionCount; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ParameterDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a function parameter. 8 | * D3D11_PARAMETER_DESC 9 | */ 10 | [CRepr] 11 | public struct ParameterDescription 12 | { 13 | /** 14 | * The name of the function parameter. 15 | */ 16 | public char8* Name; 17 | /** 18 | * The HLSL semantic that is associated with this function parameter. 19 | * This name includes the index, for example, SV_Target[n]. 20 | */ 21 | public char8* SemanticName; 22 | /** 23 | * A ShaderVariableType-typed value that identifies the variable type for the parameter. 24 | */ 25 | public ShaderVariableType Type; 26 | /** 27 | * A ShaderVariableClass-typed value that identifies the variable class for the parameter as one of scalar, vector, matrix, object, and so on. 28 | */ 29 | public ShaderVariableClass Class; 30 | /** 31 | * The number of rows for a matrix parameter. 32 | */ 33 | public uint32 Rows; 34 | /** 35 | * The number of columns for a matrix parameter. 36 | */ 37 | public uint32 Columns; 38 | /** 39 | * A InterpolationMode-typed value that identifies the interpolation mode for the parameter. 40 | */ 41 | public InterpolationMode InterpolationMode; 42 | /** 43 | * A combination of ParameterFlags-typed values that are combined by using a bitwise OR operation. 44 | * The resulting value specifies semantic flags for the parameter. 45 | */ 46 | public ParameterFlags Flags; 47 | 48 | /** 49 | * The first input register for this parameter. 50 | */ 51 | public uint32 FirstInRegister; 52 | /** 53 | * The first input register component for this parameter. 54 | */ 55 | public uint32 FirstInComponent; 56 | /** 57 | * The first output register for this parameter. 58 | */ 59 | public uint32 FirstOutRegister; 60 | /** 61 | * The first output register component for this parameter. 62 | */ 63 | public uint32 FirstOutComponent; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ShaderBufferDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a shader constant-buffer. 8 | * D3D11_SHADER_BUFFER_DESC 9 | */ 10 | [CRepr] 11 | public struct ShaderBufferDescription 12 | { 13 | /** 14 | * The name of the buffer. 15 | */ 16 | public char8* Name; 17 | /** 18 | * A D3DCBufferType-typed value that indicates the intended use of the constant data. 19 | */ 20 | public D3DCBufferType Type; 21 | /** 22 | * The number of unique variables. 23 | */ 24 | public uint32 Variables; 25 | /** 26 | * Buffer size (in bytes). 27 | */ 28 | public uint32 Size; 29 | /** 30 | * A combination of D3D_SHADER_CBUFFER_FLAGS-typed values that are combined by using a bitwise OR operation. 31 | * The resulting value specifies properties for the shader constant-buffer. 32 | */ 33 | public D3DShaderCBufferFlags Flags; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ShaderInputBindDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes how a shader resource is bound to a shader input. 8 | * D3D11_SHADER_INPUT_BIND_DESC 9 | */ 10 | [CRepr] 11 | public struct ShaderInputBindDescription 12 | { 13 | /** 14 | * Name of the shader resource. 15 | */ 16 | public char8* Name; 17 | /** 18 | * A ShaderInputType-typed value that identifies the type of data in the resource. 19 | */ 20 | public ShaderInputType Type; 21 | /** 22 | * Starting bind point. 23 | */ 24 | public uint32 BindPoint; 25 | /** 26 | * Number of contiguous bind points for arrays. 27 | */ 28 | public uint32 BindCount; 29 | /** 30 | * A combination of ShaderInputFlags-typed values for shader input-parameter options. 31 | */ 32 | public ShaderInputFlags Flags; 33 | /** 34 | * If the input is a texture, the ResourceReturnType-typed value that identifies the return type. 35 | */ 36 | public ResourceReturnType ReturnType; 37 | /** 38 | * A ShaderResourceViewDimension-typed value that identifies the dimensions of the bound resource. 39 | */ 40 | public ShaderResourceViewDimension Dimension; 41 | /** 42 | * The number of samples for a multisampled texture; 43 | * when a texture isn't multisampled, the value is set to -1 (0xFFFFFFFF). 44 | */ 45 | public int32 SampleCount; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ShaderTypeDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a shader-variable type. 8 | * D3D11_SHADER_TYPE_DESC 9 | */ 10 | [CRepr] 11 | public struct ShaderTypeDescription 12 | { 13 | /** 14 | * A ShaderVariableClass-typed value that identifies the variable class as one of scalar, vector, matrix, object, and so on. 15 | */ 16 | public ShaderVariableClass Class; 17 | /** 18 | * A ShaderVariableType-typed value that identifies the variable type. 19 | */ 20 | public ShaderVariableType Type; 21 | /** 22 | * Number of rows in a matrix. Otherwise a numeric type returns 1, any other type returns 0. 23 | */ 24 | public uint32 Rows; 25 | /** 26 | * Number of columns in a matrix. Otherwise a numeric type returns 1, any other type returns 0. 27 | */ 28 | public uint32 Columns; 29 | /** 30 | * Number of elements in an array; otherwise 0. 31 | */ 32 | public uint32 Elements; 33 | /** 34 | * Number of members in the structure; otherwise 0. 35 | */ 36 | public uint32 Members; 37 | /** 38 | * Offset, in bytes, between the start of the parent structure and this variable. Can be 0 if not a structure member. 39 | */ 40 | public uint32 Offset; 41 | /** 42 | * Name of the shader-variable type. 43 | * This member can be NULL if it isn't used. 44 | * This member supports dynamic shader linkage interface types, which have names. 45 | * For more info about dynamic shader linkage, see Dynamic Linking. 46 | */ 47 | public char8* Name; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ShaderVariableDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a shader variable. 8 | */ 9 | [CRepr] 10 | public struct ShaderVariableDescription 11 | { 12 | /** 13 | * The variable name. 14 | */ 15 | public char8* Name; 16 | /** 17 | * Offset from the start of the parent structure to the beginning of the variable. 18 | */ 19 | public uint32 StartOffset; 20 | /** 21 | * Size of the variable (in bytes). 22 | */ 23 | public uint32 Size; 24 | /** 25 | * A combination of D3DShaderVariableFlags-typed values that are combined by using a bitwise OR operation. 26 | * The resulting value identifies shader-variable properties. 27 | */ 28 | public D3DShaderVariableFlags uFlags; 29 | /** 30 | * The default value for initializing the variable. 31 | */ 32 | public void* DefaultValue; 33 | /** 34 | * Offset from the start of the variable to the beginning of the texture. 35 | */ 36 | public uint32 StartTexture; 37 | /** 38 | * The size of the texture, in bytes. 39 | */ 40 | public uint32 TextureSize; 41 | /** 42 | * Offset from the start of the variable to the beginning of the sampler. 43 | */ 44 | public uint32 StartSampler; 45 | /** 46 | * The size of the sampler, in bytes. 47 | */ 48 | public uint32 SamplerSize; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/ShaderVersionType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3D11Shader 2 | { 3 | /** 4 | * Indicates shader type. 5 | * D3D11_SHADER_VERSION_TYPE 6 | */ 7 | public enum ShaderVersionType : uint32 8 | { 9 | /** 10 | * Pixel Shader. 11 | * D3D11_SHVER_PIXEL_SHADER 12 | */ 13 | PixelShader = 0, 14 | /** 15 | * Vertex Shader. 16 | * D3D11_SHVER_VERTEX_SHADER 17 | */ 18 | VertexShader = 1, 19 | /** 20 | * Geometry Shader. 21 | * D3D11_SHVER_GEOMETRY_SHADER 22 | */ 23 | GeometryShader = 2, 24 | 25 | // D3D11 Shaders 26 | /** 27 | * Hull Shader. 28 | * D3D11_SHVER_HULL_SHADER 29 | */ 30 | HullShader = 3, 31 | /** 32 | * Domain Shader. 33 | * D3D11_SHVER_DOMAIN_SHADER 34 | */ 35 | DomainShader = 4, 36 | /** 37 | * Compute shader. 38 | * D3D11_SHVER_COMPUTE_SHADER 39 | */ 40 | ComputeShader = 5, 41 | 42 | /** 43 | * Indicates the end of the enumeration constants. 44 | * D3D11_SHVER_RESERVED0 45 | */ 46 | Reserved0 = 0xFFF0, 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/D3D11Shader/SignatureParameterDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.D3D11Shader 5 | { 6 | /** 7 | * Describes a shader signature. 8 | * D3D11_SIGNATURE_PARAMETER_DESC 9 | */ 10 | [CRepr] 11 | public struct SignatureParameterDescription 12 | { 13 | /** 14 | * A per-parameter string that identifies how the data will be used. 15 | */ 16 | public char8* SemanticName; 17 | /** 18 | * Semantic index that modifies the semantic. 19 | * Used to differentiate different parameters that use the same semantic. 20 | */ 21 | public uint32 SemanticIndex; 22 | /** 23 | * The register that will contain this variable's data. 24 | */ 25 | public uint32 Register; 26 | /** 27 | * A D3DName-typed value that identifies a predefined string that determines the functionality of certain pipeline stages. 28 | */ 29 | public D3DName SystemValueType; 30 | /** 31 | * A D3D_REGISTER_COMPONENT_TYPE-typed value that identifies the per-component-data type that is stored in a register. 32 | * Each register can store up to four-components of data. 33 | */ 34 | public D3DRegisterComponentType ComponentType; 35 | /** 36 | * Mask which indicates which components of a register are used. 37 | */ 38 | //Todo: actual type: D3D10_COMPONENT_MASK 39 | public uint8 Mask; 40 | /** 41 | * Mask which indicates whether a given component is never written (if the signature is an output signature) or always read (if the signature is an input signature). 42 | */ 43 | // Todo: actual type D3D_MASK_* 44 | public uint8 ReadWriteMask; 45 | /** 46 | * Indicates which stream the geometry shader is using for the signature parameter. 47 | */ 48 | public uint32 Stream; 49 | /** 50 | * A D3DMinPrecision-typed value that indicates the minimum desired interpolation precision. 51 | */ 52 | public D3DMinPrecision MinPrecision; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/CompressShaderFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | /** 4 | * Flags that indicate how to compress the shaders. 5 | */ 6 | public enum CompressShaderFlags : uint32 7 | { 8 | /** 9 | * D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 10 | */ 11 | KeepAllParts = 0x00000001 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/D3DShaderData.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3DCompiler 4 | { 5 | /** 6 | * Describes shader data. 7 | */ 8 | [CRepr] 9 | public struct D3DShaderData 10 | { 11 | /** 12 | * A pointer to shader data. 13 | */ 14 | public void* Bytecode; 15 | /** 16 | * Length of shader data that pBytecode points to. 17 | */ 18 | public uint BytecodeLength; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/DecompressShaderFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | /** 4 | * Flags that indicate how to decompress. 5 | */ 6 | public enum DecompressShaderFlags : uint32 7 | { 8 | /** 9 | * No flags specified. 10 | */ 11 | None = 0 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/DisassembleFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | /** 4 | * Flags affecting the behavior of D3DDisassemble. 5 | */ 6 | public enum DisassembleFlags : uint32 7 | { 8 | /** 9 | * No flags specified. 10 | */ 11 | None = 0, 12 | /** 13 | * Enable the output of color codes. 14 | * D3D_DISASM_ENABLE_COLOR_CODE 15 | */ 16 | EnableColorCode = 0x00000001, 17 | /** 18 | * Enable the output of default values. 19 | * D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 20 | */ 21 | DefaultValuePrints = 0x00000002, 22 | /** 23 | * Enable instruction numbering. 24 | * D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 25 | */ 26 | EnableInstructionNumbering = 0x00000004, 27 | /** 28 | * No effect. 29 | * D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 30 | */ 31 | EnableInstructionCycle = 0x00000008, 32 | /** 33 | * Disable debug information. 34 | * D3D_DISASM_DISABLE_DEBUG_INFO 35 | */ 36 | DisableDebugInfo = 0x00000010, 37 | /** 38 | * Enable instruction offsets. 39 | * D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 40 | */ 41 | EnableInstructionOffset = 0x00000020, 42 | /** 43 | * Disassemble instructions only. 44 | * D3D_DISASM_INSTRUCTION_ONLY 45 | */ 46 | InstructionOnly = 0x00000040, 47 | /** 48 | * Use hex symbols in disassemblies. 49 | * D3D_DISASM_PRINT_HEX_LITERALS 50 | */ 51 | PrintHexLiterals = 0x00000080 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/EffectCompileFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | /** 4 | These flags are passed in when creating an effect, and affect 5 | either compilation behavior or runtime effect behavior. 6 | */ 7 | public enum EffectCompileFlags : uint32 8 | { 9 | /** 10 | No effect compile flags 11 | */ 12 | None = 0, 13 | /** 14 | Compile this .fx file to a child effect. Child effects have no 15 | initializers for any shared values as these are initialied in the 16 | master effect (pool). 17 | D3DCOMPILE_EFFECT_CHILD_EFFECT 18 | */ 19 | ChildEffect = 1 << 0, 20 | /** 21 | By default, performance mode is enabled. Performance mode 22 | disallows mutable state objects by preventing non-literal 23 | expressions from appearing in state object definitions. 24 | Specifying this flag will disable the mode and allow for mutable 25 | state objects. 26 | D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS 27 | */ 28 | AllowSlowOps = 1 << 1 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/GetTraceInstructionOffsetFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | public enum GetTraceInstructionOffsetFlags : uint32 4 | { 5 | /** 6 | * No flags specified. 7 | */ 8 | None = 0, 9 | /** 10 | * Include non-executable code in the retrieved information. 11 | */ 12 | IncludeNonExecutable = 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/SecondaryDataFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.D3DCompiler 2 | { 3 | public enum SecondaryDataFlags : uint32 4 | { 5 | /** 6 | * No flags specified. 7 | */ 8 | None = 0, 9 | /** 10 | * Merge unordered access view (UAV) slots in the secondary data that the pSecondaryData parameter points to. 11 | * D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 12 | */ 13 | MergeUavSlots = 0x00000001, 14 | /** 15 | * Preserve template slots in the secondary data that the pSecondaryData parameter points to. 16 | * D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 17 | */ 18 | PreserveTemplateSlots = 0x00000002, 19 | /** 20 | * Require that templates in the secondary data that the pSecondaryData parameter points to match when the compiler compiles the HLSL code. 21 | * D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 22 | */ 23 | RequireTemplateMatch = 0x00000004, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/D3DCompiler/StripFlags.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.D3DCompiler 4 | { 5 | /** 6 | * Strip flag options. 7 | * D3DCOMPILER_STRIP_FLAGS 8 | */ 9 | public enum StripFlags : uint32 10 | { 11 | /** 12 | * No flags specified. 13 | */ 14 | None = 0, 15 | /** 16 | * Remove reflection data. 17 | * D3DCOMPILER_STRIP_REFLECTION_DATA 18 | */ 19 | ReflectionData = 0x00000001, 20 | /** 21 | * Remove debug information. 22 | * D3DCOMPILER_STRIP_DEBUG_INFO 23 | */ 24 | DebugInfo = 0x00000002, 25 | /** 26 | * Remove test blob data. 27 | * D3DCOMPILER_STRIP_TEST_BLOBS 28 | */ 29 | TestBlobs = 0x00000004, 30 | /** 31 | * Remove private data. 32 | * D3DCOMPILER_STRIP_PRIVATE_DATA 33 | */ 34 | PrivateData = 0x00000008, 35 | /** 36 | * Remove the root signature. 37 | * D3DCOMPILER_STRIP_ROOT_SIGNATURE 38 | */ 39 | RootSignature = 0x00000010, 40 | /** 41 | * Forces this enumeration to compile to 32 bits in size. 42 | * Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. 43 | * This value is not used. 44 | * D3DCOMPILER_STRIP_FORCE_DWORD 45 | */ 46 | ForceDword = 0x7fffffff, 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/AdapterDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | [CRepr] 7 | public struct AdapterDescription // DXGI_ADAPTER_DESC 8 | { 9 | char16[128] Description; //WCHAR[128] 10 | uint32 VendorId; 11 | uint32 DeviceId; 12 | uint32 SubSysId; 13 | uint32 Revision; 14 | SIZE_T DedicatedVideoMemory; 15 | SIZE_T DedicatedSystemMemory; 16 | SIZE_T SharedSystemMemory; 17 | Luid AdapterLuid; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/AdapterDescription1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | [CRepr] 7 | public struct AdapterDescription1 // DXGI_ADAPTER_DESC1 8 | { 9 | public char16[128] Description; //WCHAR[128] 10 | public uint32 VendorId; 11 | public uint32 DeviceId; 12 | public uint32 SubSysId; 13 | public uint32 Revision; 14 | public SIZE_T DedicatedVideoMemory; 15 | public SIZE_T DedicatedSystemMemory; 16 | public SIZE_T SharedSystemMemory; 17 | public Luid AdapterLuid; 18 | public AdapterFlags Flags; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/AdapterFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | Identifies the type of DXGI adapter. 5 | DXGI_ADAPTER_FLAG 6 | */ 7 | public enum AdapterFlags : uint32 8 | { 9 | /** 10 | Specifies no flags. 11 | DXGI_ADAPTER_FLAG_NONE 12 | */ 13 | None = 0, 14 | /** 15 | Value always set to 0. This flag is reserved. 16 | DXGI_ADAPTER_FLAG_REMOTE 17 | */ 18 | Remote = 1, 19 | /** 20 | Specifies a software adapter. For more info about this flag, see new info in Windows 8 about enumerating adapters. 21 | Direct3D 11: This enumeration value is supported starting with Windows 8. 22 | DXGI_ADAPTER_FLAG_SOFTWARE 23 | */ 24 | Software = 2, 25 | /** 26 | Forces this enumeration to compile to 32 bits in size. 27 | Without this value, some compilers would allow this enumeration to compile 28 | to a size other than 32 bits. This value is not used. 29 | DXGI_ADAPTER_FLAG_FORCE_DWORD 30 | */ 31 | ForceDword = 0xffffffff 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | static 7 | { 8 | /** 9 | * Creates a DXGI 1.1 factory that you can use to generate other DXGI objects. 10 | @param rrid The globally unique identifier (GUID) of the IDXGIFactory1 object referenced by the ppFactory parameter. 11 | @param ppFactory Address of a pointer to an IDXGIFactory1 object. 12 | @return Returns S_OK if successful; an error code otherwise. 13 | */ 14 | [Import("DXGI.lib"), CLink, CallingConvention(.Stdcall)] 15 | public static extern HResult CreateDXGIFactory(ref Guid riid, out IDXGIFactory* ppFactory); 16 | 17 | /** 18 | * Creates a DXGI 1.1 factory that you can use to generate other DXGI objects. 19 | @param rrid The globally unique identifier (GUID) of the IDXGIFactory1 object referenced by the ppFactory parameter. 20 | @param ppFactory Address of a pointer to an IDXGIFactory1 object. 21 | @return Returns S_OK if successful; an error code otherwise. 22 | */ 23 | [Import("DXGI.lib"), CLink, CallingConvention(.Stdcall)] 24 | public static extern HResult CreateDXGIFactory1(ref Guid riid, out IDXGIFactory1* ppFactory); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/AlphaMode.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | public enum AlphaMode // DXGI_ALPHA_MODE 4 | { 5 | DXGI_ALPHA_MODE_UNSPECIFIED = 0, 6 | DXGI_ALPHA_MODE_PREMULTIPLIED = 1, 7 | DXGI_ALPHA_MODE_STRAIGHT = 2, 8 | DXGI_ALPHA_MODE_IGNORE = 3, 9 | DXGI_ALPHA_MODE_FORCE_DWORD = 0xffffffff 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/ComputePreemtionGranularity.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | /** 4 | * Identifies the granularity at which the graphics processing unit (GPU) can be preempted from performing its current compute task. 5 | */ 6 | public enum ComputePreemtionGranularity : uint32 7 | { 8 | /** 9 | * Indicates the preemption granularity as a compute packet. 10 | * DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY 11 | */ 12 | DmaBufferBoundary = 0, 13 | /** 14 | * Indicates the preemption granularity as a dispatch (for example, a call to the ID3D11DeviceContext::Dispatch method). 15 | * A dispatch is a part of a compute packet. 16 | * DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY 17 | */ 18 | DispatchBoundardy = 1, 19 | /** 20 | * Indicates the preemption granularity as a thread group. 21 | * A thread group is a part of a dispatch. 22 | * DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY 23 | */ 24 | ThreadGroupBoundary = 2, 25 | /** 26 | * Indicates the preemption granularity as a thread in a thread group. 27 | * A thread is a part of a thread group. 28 | * DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY 29 | */ 30 | ThreadBoundary = 3, 31 | /** 32 | * Indicates the preemption granularity as a compute instruction in a thread. 33 | * DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY 34 | */ 35 | InstructionBoundary = 4 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/DXGI1_2.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI.DXGI1_2 5 | { 6 | static 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/GraphicsPreemtionGranularity.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | /** 4 | * Identifies the granularity at which the graphics processing unit (GPU) can be preempted from performing its current graphics rendering task. 5 | */ 6 | public enum GraphicsPreemtionGranularity : uint32 7 | { 8 | /** 9 | * Indicates the preemption granularity as a DMA buffer. 10 | * DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY 11 | */ 12 | DmaBufferBoundary = 0, 13 | /** 14 | * Indicates the preemption granularity as a graphics primitive. 15 | * A primitive is a section in a DMA buffer and can be a group of triangles. 16 | * DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY 17 | */ 18 | PrimitiveBoundary = 1, 19 | /** 20 | * Indicates the preemption granularity as a triangle. 21 | * A triangle is a part of a primitive. 22 | * DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY 23 | */ 24 | TriangleBoundary = 2, 25 | /** 26 | * Indicates the preemption granularity as a pixel. 27 | * A pixel is a part of a triangle. 28 | * DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY 29 | */ 30 | PixelBoundary = 3, 31 | /** 32 | * Indicates the preemption granularity as a graphics instruction. 33 | * A graphics instruction operates on a pixel. 34 | * DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY 35 | */ 36 | InstructionBoundardy = 4 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/IDXGIAdapter2.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX; 3 | using DirectX.Common; 4 | 5 | namespace DirectX.DXGI.DXGI1_2 6 | { 7 | /** 8 | * The IDXGIAdapter2 interface represents a display subsystem, which includes one or more GPUs, DACs, and video memory. 9 | */ 10 | public struct IDXGIAdapter2 : IDXGIAdapter1, IComObject 11 | { 12 | public static new Guid IID => .("0AA1AE0A-FA0E-4B84-8644-E05FF8E5ACB5"); 13 | 14 | public struct VTable : IDXGIAdapter1.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGIAdapter2* self, AdapterDescription2 *pDesc) GetDesc2; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Gets a Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 description of an adapter or video card. 27 | * This description includes information about the granularity at which the graphics processing unit (GPU) can be preempted from performing its current task. 28 | * 29 | * @param desc A reference to a AdapterDescription2 structure that describes the adapter. 30 | * On feature level 9 graphics hardware, earlier versions of GetDescription2 (GetDescription and GetDescription1) return zeros for the PCI ID in the VendorId, 31 | * DeviceId, SubSysId, and Revision members of the adapter description structure and “Software Adapter” for the description string in the Description member. 32 | * GetDescription2 returns the actual feature level 9 hardware values in these members. 33 | */ 34 | public HResult GetDescription2(out AdapterDescription2 desc) mut 35 | { 36 | desc = ?; 37 | return VT.GetDesc2(&this, &desc); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/IDXGIDisplayControl.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX; 3 | using DirectX.Common; 4 | 5 | namespace DirectX.DXGI.DXGI1_2 6 | { 7 | /** 8 | * The IDXGIDisplayControl interface exposes methods to indicate user preference for the operating system's stereoscopic 3D display behavior and to set stereoscopic 3D display status to enable or disable. 9 | */ 10 | public struct IDXGIDisplayControl : IUnknown, IComObject 11 | { 12 | public static new Guid IID => .("ea9dbf1a-c88e-4486-854a-98aa0138f30c"); 13 | 14 | public struct VTable : IUnknown.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] BOOL(IDXGIDisplayControl* self) IsStereoEnabled; 17 | public function [CallingConvention(.Stdcall)] void(IDXGIDisplayControl* self, BOOL enabled) SetStereoEnabled; 18 | } 19 | 20 | public new VTable* VT 21 | { 22 | [Inline] 23 | get => (.)mVT; 24 | } 25 | 26 | /** 27 | * Retrieves a Boolean value that indicates whether the operating system's stereoscopic 3D display behavior is enabled. 28 | * 29 | * @return IsStereoEnabled returns TRUE when the operating system's stereoscopic 3D display behavior is enabled and FALSE when this behavior is disabled. 30 | */ 31 | public BOOL IsStereoEnabled() mut 32 | { 33 | return VT.IsStereoEnabled(&this); 34 | } 35 | 36 | /** 37 | * Set a Boolean value to either enable or disable the operating system's stereoscopic 3D display behavior. 38 | * 39 | * @param enabled A Boolean value that either enables or disables the operating system's stereoscopic 3D display behavior. 40 | * TRUE enables the operating system's stereoscopic 3D display behavior and FALSE disables it. 41 | */ 42 | public void SetStereoEnabled(BOOL enabled) mut 43 | { 44 | VT.SetStereoEnabled(&this, enabled); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/IDXGIOutputDuplication.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | // Todo: implement IDXGIOutputDuplication 4 | // https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_2/nn-dxgi1_2-idxgioutputduplication 5 | public struct IDXGIOutputDuplication 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/IDXGISurface2.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | using DirectX.Math; 4 | 5 | namespace DirectX.DXGI.DXGI1_2 6 | { 7 | /** 8 | * The IDXGISurface2 interface extends the IDXGISurface1 interface by adding support for subresource surfaces and getting a handle to a shared resource. 9 | */ 10 | public struct IDXGISurface2 : IDXGISurface1, IComObject 11 | { 12 | public static new Guid IID => .("aba496dd-b617-4cb8-a866-bc44d7eb1fa2"); 13 | 14 | public struct VTable : IDXGISurface1.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface2 *self, Guid *riid, void **ppParentResource, UINT *pSubresourceIndex) GetResource; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Gets the parent resource and subresource index that support a subresource surface. 27 | * 28 | * @param iid The globally unique identifier (GUID) of the requested interface type. 29 | * @param parentResource A reference to a buffer that receives a pointer to the parent resource object for the subresource surface. 30 | * @param subresourceIndex A reference to a variable that receives the index of the subresource surface. 31 | */ 32 | public HResult GetResource(Guid iid, out void *parentResource, out UINT subresourceIndex) mut 33 | { 34 | Guid riid = iid; 35 | parentResource = ?; 36 | subresourceIndex = ?; 37 | return VT.GetResource(&this, &riid, &parentResource, &subresourceIndex); 38 | } 39 | 40 | /** 41 | * Gets the parent resource and subresource index that support a subresource surface. 42 | * 43 | * @param parentResource A reference to a buffer that receives a pointer to the parent resource object for the subresource surface. 44 | * @param subresourceIndex A reference to a variable that receives the index of the subresource surface. 45 | */ 46 | public HResult GetResource(out T *parentResource, out UINT subresourceIndex) mut where T : IUnknown, IComObject 47 | { 48 | Guid riid = T.IID; 49 | parentResource = ?; 50 | subresourceIndex = ?; 51 | return VT.GetResource(&this, &riid, (.)&parentResource, &subresourceIndex); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/ModeDescription1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI.DXGI1_2 4 | { 5 | /** 6 | * Describes a display mode and whether the display mode supports stereo. 7 | */ 8 | [CRepr] 9 | public struct ModeDescription1 : ModeDescription 10 | { 11 | /** 12 | * Specifies whether the full-screen display mode is stereo. 13 | * TRUE if stereo; otherwise, FALSE. 14 | */ 15 | public BOOL Stereo; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/OfferResourcePriority.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | /** 4 | * Identifies the importance of a resource’s content when you call the IDXGIDevice2::OfferResources method to offer the resource. 5 | * DXGI_OFFER_RESOURCE_PRIORITY 6 | */ 7 | public enum OfferResourcePriority : uint32 8 | { 9 | /** 10 | * The resource is low priority. 11 | * The operating system discards a low priority resource before other offered resources with higher priority. 12 | * It is a good programming practice to mark a resource as low priority if it has no useful content. 13 | * DXGI_OFFER_RESOURCE_PRIORITY_LOW 14 | */ 15 | Low = 1, 16 | /** 17 | * The resource is normal priority. 18 | * You mark a resource as normal priority if it has content that is easy to regenerate. 19 | * DXGI_OFFER_RESOURCE_PRIORITY_NORMAL 20 | */ 21 | Normal = (Low + 1), 22 | /** 23 | * The resource is high priority. 24 | * The operating system discards other offered resources with lower priority before it discards a high priority resource. 25 | * You mark a resource as high priority if it has useful content that is difficult to regenerate. 26 | * DXGI_OFFER_RESOURCE_PRIORITY_HIGH 27 | */ 28 | High = (Normal + 1), 29 | /** 30 | * None. This is an invalid value. 31 | */ 32 | None = 0 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/PresentParameters.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Math; 3 | 4 | namespace DirectX.DXGI.DXGI1_2 5 | { 6 | /** 7 | Describes information about present that helps the operating system optimize presentation. 8 | DXGI_PRESENT_PARAMETERS 9 | */ 10 | [CRepr] 11 | public struct PresentParameters 12 | { 13 | /** 14 | The number of updated rectangles that you update in the back buffer for the presented frame. 15 | The operating system uses this information to optimize presentation. 16 | You can set this member to 0 to indicate that you update the whole frame. 17 | */ 18 | public uint32 DirtyRectsCount; 19 | /** 20 | A list of updated rectangles that you update in the back buffer for the presented frame. 21 | An application must update every single pixel in each rectangle that it reports to the runtime; 22 | the application cannot assume that the pixels are saved from the previous frame. 23 | For more information about updating dirty rectangles, see Remarks. 24 | You can set this member to NULL if DirtyRectsCount is 0. 25 | An application must not update any pixel outside of the dirty rectangles. 26 | */ 27 | public Rectangle *pDirtyRects; 28 | /** 29 | A pointer to the scrolled rectangle. 30 | The scrolled rectangle is the rectangle of the previous frame from which the runtime bit-block transfers (bitblts) content. 31 | The runtime also uses the scrolled rectangle to optimize presentation in terminal server and indirect display scenarios. 32 | 33 | The scrolled rectangle also describes the destination rectangle, that is, the region on the current frame that is filled with scrolled content. 34 | You can set this member to NULL to indicate that no content is scrolled from the previous frame. 35 | */ 36 | public Rectangle *pScrollRect; 37 | /** 38 | A pointer to the offset of the scrolled area that goes from the source rectangle (of previous frame) to the destination rectangle (of current frame). 39 | You can set this member to NULL to indicate no offset. 40 | */ 41 | public Point *pScrollOffset; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/ResourceAccessRight.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | public enum ResourceAccessRight : uint32 4 | { 5 | /** 6 | * Specifies read access to the resource. 7 | */ 8 | Read = 0x80000000L, 9 | /** 10 | * Write access. 11 | */ 12 | Write = 0x40000000L, 13 | /** 14 | * Execute access. 15 | */ 16 | Execute = 0x20000000L, 17 | /** 18 | * All possible access rights. 19 | */ 20 | All = 0x10000000L, 21 | /** 22 | * Specifies write access to the resource. 23 | */ 24 | SharedResourceWrite = 1 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/Scaling.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI.DXGI1_2 2 | { 3 | public enum Scaling : uint32 4 | { 5 | DXGI_SCALING_STRETCH = 0, 6 | DXGI_SCALING_NONE = 1, 7 | DXGI_SCALING_ASPECT_RATIO_STRETCH = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/SwapChainDescription1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.DXGI; 3 | 4 | namespace DirectX.DXGI.DXGI1_2 5 | { 6 | [CRepr] 7 | public struct SwapChainDescription1 // DXGI_SWAP_CHAIN_DESC1 8 | { 9 | public uint32 Width; 10 | public uint32 Height; 11 | public Format Format; 12 | public bool Stereo; 13 | public SampleDescription SampleDescription; 14 | public Usage BufferUsage; 15 | public uint32 BufferCount; 16 | public DXGI1_2.Scaling Scaling; 17 | public SwapEffect SwapEffect; // DXGI_SWAP_EFFECT 18 | public AlphaMode AlphaMode; 19 | public SwapChainFlags Flags; // uint 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/DXGI1_2/SwapChainFullscreenDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI.DXGI1_2 5 | { 6 | [CRepr] 7 | public struct SwapChainFullscreenDescription 8 | { 9 | public Rational RefreshRate; 10 | public ScanlineOrder ScanlineOrdering; 11 | public DXGI1_2.Scaling Scaling; 12 | public bool Windowed; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/EnumerationModes.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | * Options for enumerating display modes. 5 | * DXGI_ENUM_MODES 6 | */ 7 | public enum EnumerationMode : uint32 8 | { 9 | /** 10 | * Include interlaced modes. 11 | * DXGI_ENUM_MODES_INTERLACED 12 | */ 13 | Interlaced = 1UL, 14 | /** 15 | * Include stretched-scaling modes. 16 | * DXGI_ENUM_MODES_SCALING 17 | */ 18 | Scaling = 2UL, 19 | /** 20 | * nclude stereo modes. 21 | * DXGI_ENUM_MODES_INTERLACED 22 | */ 23 | DXGI_ENUM_MODES_STEREO = 4UL, 24 | /** 25 | * Include stereo modes that are hidden because the user has disabled stereo. 26 | * DXGI_ENUM_MODES_INTERLACED 27 | */ 28 | DXGI_ENUM_MODES_DISABLED_STEREO = 8UL, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/FrameStatistics.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | // Todo: document 7 | [CRepr] 8 | public struct FrameStatistics // DXGI_FRAME_STATISTICS 9 | { 10 | public uint32 PresentCount; 11 | public uint32 PresentRefreshCount; 12 | public uint32 SyncRefreshCount; 13 | public LargerInteger SyncQPCTime; // LARGE_INTEGER 14 | public LargerInteger SyncGPUTime; // LARGE_INTEGER 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/GammaControl.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Controls the settings of a gamma curve. 7 | */ 8 | [CRepr] 9 | public struct GammaControl 10 | { 11 | /** 12 | * A ColorRGB structure with scalar values that are applied to rgb values before being sent to the gamma look up table. 13 | */ 14 | public ColorRGB Scale; 15 | /** 16 | * A ColorRGB structure with offset values that are applied to the rgb values before being sent to the gamma look up table. 17 | */ 18 | public ColorRGB Offset; 19 | /** 20 | * An array of ColorRGB structures that control the points of a gamma curve. 21 | */ 22 | public ColorRGB[1025] GammaCurve; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/GammaControlCapabilities.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Controls the gamma capabilities of an adapter. 7 | */ 8 | [CRepr] 9 | public struct GammaControlCapabilities 10 | { 11 | /** 12 | * True if scaling and offset operations are supported during gamma correction; otherwise, false. 13 | */ 14 | public BOOL ScaleAndOffsetSupported; 15 | /** 16 | * A value describing the maximum range of the control-point positions. 17 | */ 18 | public float MaxConvertedValue; 19 | /** 20 | * A value describing the minimum range of the control-point positions. 21 | */ 22 | public float MinConvertedValue; 23 | /** 24 | * A value describing the number of control points in the array. 25 | */ 26 | public UINT NumGammaControlPoints; 27 | /** 28 | * An array of values describing control points; the maximum length of control points is 1025. 29 | */ 30 | public float[1025] ControlPointPositions; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGIAdapter1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX; 3 | using DirectX.Common; 4 | 5 | namespace DirectX.DXGI 6 | { 7 | /** 8 | * The IDXGIAdapter1 interface represents a display sub-system (including one or more GPU's, DACs and video memory). 9 | */ 10 | public struct IDXGIAdapter1 : IDXGIAdapter, IComObject 11 | { 12 | public static new Guid IID => .("29038f61-3839-4626-91fd-086879011a05"); 13 | 14 | public struct VTable : IDXGIAdapter.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGIAdapter1* self, AdapterDescription1 *pDesc)GetDesc1; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Gets a DXGI 1.1 description of an adapter (or video card). 27 | * 28 | * @param desc A pointer to a AdapterDescription1 structure that describes the adapter. 29 | * On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of AdapterDescription1 and “Software Adapter” for the description string in the Description member. 30 | */ 31 | public HResult GetDescription1(out AdapterDescription1 desc) mut 32 | { 33 | desc = ?; 34 | return VT.GetDesc1(&this, &desc); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGIDevice1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | /** 7 | * An IDXGIDevice1 interface implements a derived class for DXGI objects that produce image data. 8 | */ 9 | public struct IDXGIDevice1 : IDXGIDevice, IComObject 10 | { 11 | public static new Guid IID => .("77db970f-6276-48ba-ba28-070143b4392c"); 12 | 13 | public struct VTable : IDXGIDevice.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(IDXGIDevice1* self, UINT maxLatency) SetMaximumFrameLatency; 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGIDevice1* self, UINT *pMaxLatency) GetMaximumFrameLatency; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Gets the number of frames that the system is allowed to queue for rendering. 27 | * 28 | * @param maxLatency This value is set to the number of frames that can be queued for render. 29 | * This value defaults to 3, but can range from 1 to 16. 30 | */ 31 | public HResult GetMaximumFrameLatency(out UINT maxLatency) mut 32 | { 33 | maxLatency = ?; 34 | return VT.GetMaximumFrameLatency(&this, &maxLatency); 35 | } 36 | 37 | /** 38 | * Sets the number of frames that the system is allowed to queue for rendering. 39 | * 40 | * @param maxLatency The maximum number of back buffer frames that a driver can queue. 41 | * The value defaults to 3, but can range from 1 to 16. 42 | * A value of 0 will reset latency to the default. 43 | * For multi-head devices, this value is specified per-head. 44 | */ 45 | public HResult SetMaximumFrameLatency(UINT maxLatency) mut 46 | { 47 | return VT.SetMaximumFrameLatency(&this, maxLatency); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGIDeviceSubObject.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | /** 7 | * Inherited from objects that are tied to the device so that they can retrieve a pointer to it. 8 | */ 9 | public struct IDXGIDeviceSubObject : IDXGIObject, IComObject 10 | { 11 | public static new Guid IID => .("3d3e0379-f9de-4d58-bb6c-18d62992f1a6"); 12 | 13 | public struct VTable : IDXGIObject.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(IDXGIDeviceSubObject* self, Guid* riid, void** ppDevice) GetDevice; 16 | } 17 | 18 | public new VTable* VT 19 | { 20 | [Inline] 21 | get => (.)mVT; 22 | } 23 | 24 | /** 25 | * Retrieves the device. 26 | * 27 | * @param iid The id for the device. 28 | * @param ppDevice The address of a pointer to the device. 29 | */ 30 | public HResult GetDevice(Guid iid, void **ppDevice) mut 31 | { 32 | Guid riid = iid; 33 | return VT.GetDevice(&this, &riid, ppDevice); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGIFactory1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | /** 7 | * The IDXGIFactory1 interface implements methods for generating DXGI objects. 8 | */ 9 | public struct IDXGIFactory1 : IDXGIFactory, IComObject 10 | { 11 | public static new Guid IID => .("770aae78-f26f-4dba-a829-253c83d1b387"); 12 | 13 | public struct VTable : IDXGIFactory.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(IDXGIFactory1* self, uint32 adapter, IDXGIAdapter1** ppAdapter) EnumAdapters1; 16 | public function [CallingConvention(.Stdcall)] BOOL(IDXGIFactory1* self) IsCurrent; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | 25 | /** 26 | * Enumerates both adapters (video cards) with or without outputs. 27 | * 28 | * @param adapter The index of the adapter to enumerate. 29 | * @param pAdapter The address of a pointer to an IDXGIAdapter1 interface at the position specified by the Adapter parameter. 30 | */ 31 | public HResult EnumAdapters1(uint32 adapter, out IDXGIAdapter1* pAdapter) mut 32 | { 33 | pAdapter = ?; 34 | return VT.EnumAdapters1(&this, adapter, &pAdapter); 35 | } 36 | 37 | /** 38 | * Informs an application of the possible need to re-enumerate adapters. 39 | * 40 | * @return FALSE, if a new adapter is becoming available or the current adapter is going away. TRUE, no adapter changes. 41 | * IsCurrent returns FALSE to inform the calling application to re-enumerate adapters. 42 | */ 43 | public BOOL IsCurrent() mut 44 | { 45 | return VT.IsCurrent(&this); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGISurface.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | /** 7 | * The IDXGISurface interface implements methods for image-data objects. 8 | */ 9 | public struct IDXGISurface : IDXGIDeviceSubObject, IComObject 10 | { 11 | public static new Guid IID => .("cafcb56c-6ac3-4889-bf47-9e23bbd260ec"); 12 | 13 | public struct VTable : IDXGIDeviceSubObject.VTable 14 | { 15 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface *self, SurfaceDescription *pDesc) GetDesc; 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface *self, MappedRectangle *pLockedRect, MapFlags mapFlags) Map; 17 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface *self) Unmap; 18 | } 19 | 20 | public new VTable* VT 21 | { 22 | [Inline] 23 | get => (.)mVT; 24 | } 25 | 26 | /** 27 | * Get a description of the surface. 28 | * 29 | * @param desc A reference to the surface description. 30 | */ 31 | public HResult GetDescription(out SurfaceDescription desc) mut 32 | { 33 | desc = ?; 34 | return VT.GetDesc(&this, &desc); 35 | } 36 | 37 | /** 38 | * Get a pointer to the data contained in the surface, and deny GPU access to the surface. 39 | * 40 | * @param lockedRect A reference to the surface data. 41 | * @param mapFlags CPU read-write flags. 42 | */ 43 | public HResult Map(out MappedRectangle lockedRect, MapFlags mapFlags) mut 44 | { 45 | lockedRect = ?; 46 | return VT.Map(&this, &lockedRect, mapFlags); 47 | } 48 | 49 | /** 50 | * Invalidate the pointer to the surface retrieved by IDXGISurface::Map and re-enable GPU access to the resource. 51 | */ 52 | public HResult Unmap() mut 53 | { 54 | return VT.Unmap(&this); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/IDXGISurface1.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | using DirectX.Math; 4 | 5 | namespace DirectX.DXGI 6 | { 7 | /** 8 | * The IDXGISurface1 interface extends the IDXGISurface by adding support for using Windows Graphics Device Interface (GDI) to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface. 9 | */ 10 | public struct IDXGISurface1 : IDXGISurface, IComObject 11 | { 12 | public static new Guid IID => .("4AE63092-6327-4c1b-80AE-BFE12EA32B86"); 13 | 14 | public struct VTable : IDXGISurface.VTable 15 | { 16 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface *self, BOOL discard, Windows.Handle *phdc) GetDC; 17 | public function [CallingConvention(.Stdcall)] HResult(IDXGISurface *self, Rectangle *pDirctyRect) ReleaseDC; 18 | } 19 | 20 | public new VTable* VT 21 | { 22 | [Inline] 23 | get => (.)mVT; 24 | } 25 | 26 | /** 27 | * Returns a device context (DC) that allows you to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface using Windows Graphics Device Interface (GDI). 28 | * 29 | * @param discard A Boolean value that specifies whether to preserve Direct3D contents in the GDI DC. 30 | * TRUE directs the runtime not to preserve Direct3D contents in the GDI DC; 31 | * that is, the runtime discards the Direct3D contents. 32 | * FALSE guarantees that Direct3D contents are available in the GDI DC. 33 | * @param hdc A reference to an HDC handle that represents the current device context for GDI rendering. 34 | */ 35 | public HResult GetDeviceContext(BOOL discard, out Windows.Handle hdc) mut 36 | { 37 | hdc = ?; 38 | return VT.GetDC(&this, discard, &hdc); 39 | } 40 | 41 | 42 | /** 43 | * Releases the GDI device context (DC) that is associated with the current surface and allows you to use Direct3D to render. 44 | * 45 | * @param pDirctyRect A pointer to a RECT structure that identifies the dirty region of the surface. 46 | */ 47 | public HResult ReleaseDeviceContext(Rectangle *pDirctyRect) mut 48 | { 49 | return VT.ReleaseDC(&this, pDirctyRect); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/MapFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | public enum MapFlags : uint32 4 | { 5 | /** 6 | * Allow CPU read access. 7 | */ 8 | Read = 1, 9 | /** 10 | * Allow CPU write access. 11 | */ 12 | Write = 2, 13 | /** 14 | * Discard the previous contents of a resource when it is mapped. 15 | */ 16 | Discard = 4 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/MappedRectangle.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Describes a mapped rectangle that is used to access a surface. 7 | */ 8 | [CRepr] 9 | public struct MappedRectangle 10 | { 11 | /** 12 | * A value that describes the width, in bytes, of the surface. 13 | */ 14 | public INT Pitch; 15 | /** 16 | * A pointer to the image buffer of the surface. 17 | */ 18 | public uint8 *pBits; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/ModeDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Describes a display mode. 7 | */ 8 | [CRepr] 9 | public struct ModeDescription 10 | { 11 | /** 12 | * A value that describes the resolution width. 13 | */ 14 | public uint32 Width; 15 | /** 16 | * A value that describes the resolution height. 17 | */ 18 | public uint32 Height; 19 | /** 20 | * A Rational that describes the refresh rate in hertz. 21 | */ 22 | public Rational RefreshRate; 23 | /** 24 | * A Format value that describes the display format. 25 | */ 26 | public Format Format; 27 | /** 28 | * A ScanlineOrder value that describes the scan-line drawing mode. 29 | */ 30 | public ScanlineOrder ScanlineOrdering; 31 | /** 32 | * A Scaling value that describes the scaling mode. 33 | */ 34 | public Scaling Scaling; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/ModeRotation.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | public enum ModeRotation : int32 4 | { 5 | Unspecified = 0, // DXGI_MODE_ROTATION_UNSPECIFIED 6 | Identity = 1, // DXGI_MODE_ROTATION_IDENTITY 7 | Rotate90 = 2, // DXGI_MODE_ROTATION_ROTATE90 8 | Rotate180 = 3, // DXGI_MODE_ROTATION_ROTATE180 9 | Rotate270 = 4 // DXGI_MODE_ROTATION_ROTATE270 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/OutputDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Math; 3 | 4 | namespace DirectX.DXGI 5 | { 6 | [CRepr] 7 | class OutputDescription // DXGI_OUTPUT_DESC 8 | { 9 | public char16[32] DeviceName; // WCHAR 10 | public Rectangle DesktopCoordinates; // RECT 11 | public bool AttachedToDesktop; 12 | public ModeRotation Rotation; // DXGI_MODE_ROTATION 13 | public Windows.Handle Monitor; // HMONITOR 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/Rational.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | // Todo: It is placed in dxgicommon -> Common-Namespace? 6 | /** 7 | Represents a rational number. 8 | Link: https://docs.microsoft.com/en-us/windows/win32/api/dxgicommon/ns-dxgicommon-dxgi_rational 9 | */ 10 | [CRepr] 11 | public struct Rational // DXGI_RATIONAL 12 | { 13 | /** 14 | An unsigned integer value representing the top of the rational number. 15 | */ 16 | public uint32 Numerator; 17 | /** 18 | An unsigned integer value representing the bottom of the rational number. 19 | */ 20 | public uint32 Denominator; 21 | 22 | public this() 23 | { 24 | this = default; 25 | 26 | } 27 | 28 | public this(uint32 numerator, uint32 denominator) 29 | { 30 | Numerator = numerator; 31 | Denominator = denominator; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/Residency.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | * Flags indicating the memory location of a resource. 5 | * DXGI_RESIDENCY 6 | */ 7 | public enum Residency : uint32 8 | { 9 | /** 10 | * The resource is located in video memory. 11 | * DXGI_RESIDENCY_FULLY_RESIDENT 12 | */ 13 | FullyResident = 1, 14 | /** 15 | * At least some of the resource is located in CPU memory. 16 | * DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY 17 | */ 18 | SharedMemory = 2, 19 | /** 20 | * At least some of the resource has been paged out to the hard drive. 21 | * DXGI_RESIDENCY_EVICTED_TO_DISK 22 | */ 23 | EvictedToDisk = 3 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/ResourcePriority.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | The eviction priority of a resource. 5 | */ 6 | public enum ResourcePriority : uint32 7 | { 8 | /** 9 | DXGI_RESOURCE_PRIORITY_MINIMUM: 10 | */ 11 | Minimum = 0x28000000, 12 | /** 13 | DXGI_RESOURCE_PRIORITY_LOW: 14 | */ 15 | Low = 0x50000000, 16 | /** 17 | DXGI_RESOURCE_PRIORITY_NORMAL 18 | */ 19 | Normal = 0x78000000 , 20 | /** 21 | DXGI_RESOURCE_PRIORITY_HIGH 22 | */ 23 | High = 0xa0000000 , 24 | /** 25 | DXGI_RESOURCE_PRIORITY_MAXIMUM 26 | */ 27 | Maximum = 0xc8000000 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SampleDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Describes multi-sampling parameters for a resource. 7 | */ 8 | [CRepr] 9 | public struct SampleDescription 10 | { 11 | /** 12 | * The number of multisamples per pixel. 13 | */ 14 | public uint32 Count; 15 | /** 16 | * The image quality level. 17 | */ 18 | public uint32 Quality; 19 | 20 | public this() 21 | { 22 | this = default; 23 | } 24 | 25 | public this(uint32 count, uint32 quality) 26 | { 27 | Count = count; 28 | Quality = quality; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/Scaling.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | // Todo: C#ify 4 | public enum Scaling : uint32 // DXGI_MODE_SCALING 5 | { 6 | DXGI_MODE_SCALING_UNSPECIFIED = 0, 7 | DXGI_MODE_SCALING_CENTERED = 1, 8 | DXGI_MODE_SCALING_STRETCHED = 2 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/ScanlineOrder.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | // Todo: C#ify 4 | public enum ScanlineOrder : uint32 // DXGI_MODE_SCANLINE_ORDER 5 | { 6 | DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0, 7 | DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1, 8 | DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, 9 | DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SharedResource.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Represents a handle to a shared resource. 7 | */ 8 | [CRepr] 9 | public struct SharedResource 10 | { 11 | /** 12 | * A handle to a shared resource. 13 | */ 14 | public Windows.Handle Handle; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SurfaceDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | /** 6 | * Describes a surface. 7 | */ 8 | [CRepr] 9 | public struct SurfaceDescription 10 | { 11 | /** 12 | * A value describing the surface width. 13 | */ 14 | public UINT Width; 15 | /** 16 | * A value describing the surface height. 17 | */ 18 | public UINT Height; 19 | /** 20 | * A member of the Format enumerated type that describes the surface format. 21 | */ 22 | public Format Format; 23 | /** 24 | * A SampleDescription structure that describes multi-sampling parameters for the surface. 25 | */ 26 | public SampleDescription SampleDesc; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SwapChainDescription.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.DXGI 4 | { 5 | [CRepr] 6 | public struct SwapChainDescription // DXGI_SWAP_CHAIN_DESC 7 | { 8 | public ModeDescription BufferDesc; // DXGI_MODE_DESC 9 | public SampleDescription SampleDesc; // DXGI_SAMPLE_DESC 10 | public Usage BufferUsage; // DXGI_USAGE 11 | public uint32 BufferCount; // uint 12 | public Windows.Handle OutputWindow; // HWND 13 | public bool Windowed; 14 | public SwapEffect SwapEffect; // DXGI_SWAP_EFFECT 15 | public SwapChainFlags Flags; // uint 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SwapChainFlag.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | // Todo: C#ify 4 | // Link: https://docs.microsoft.com/en-us/windows/win32/api/dxgi/ne-dxgi-dxgi_swap_chain_flag 5 | public enum SwapChainFlags : uint32 // DXGI_SWAP_CHAIN_FLAG 6 | { 7 | DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1, 8 | DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2, 9 | DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4, 10 | DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 8, 11 | DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 16, 12 | DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 32, 13 | DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 64, 14 | DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 128, 15 | DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 256, 16 | DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 512, 17 | DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024, 18 | DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 2048, 19 | DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 4096, 20 | None = 0 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/SwapEffect.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | * Options for handling pixels in a display surface after calling IDXGISwapChain1::Present1. 5 | * DXGI_SWAP_EFFECT 6 | */ 7 | public enum SwapEffect : uint32 8 | { 9 | /** 10 | * Use this flag to specify the bit-block transfer (bitblt) model and to specify that DXGI discard the contents of the back buffer after you call IDXGISwapChain1::Present1. 11 | * This flag is valid for a swap chain with more than one back buffer, although, applications only have read and write access to buffer 0. 12 | * Use this flag to enable the display driver to select the most efficient presentation technique for the swap chain. 13 | * DXGI_SWAP_EFFECT_DISCARD 14 | */ 15 | Discard = 0, 16 | /** 17 | * Use this flag to specify the bitblt model and to specify that DXGI persist the contents of the back buffer after you call IDXGISwapChain1::Present1. 18 | * Use this option to present the contents of the swap chain in order, from the first buffer (buffer 0) to the last buffer. 19 | * This flag cannot be used with multisampling. 20 | * DXGI_SWAP_EFFECT_SEQUENTIAL 21 | */ 22 | Sequential = 1, 23 | /** 24 | * Use this flag to specify the flip presentation model and to specify that DXGI persist the contents of the back buffer after you call IDXGISwapChain1::Present1. 25 | * This flag cannot be used with multisampling. 26 | * Direct3D 11: This enumeration value is supported starting with Windows 8. 27 | * DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL 28 | */ 29 | FlipSequential = 3, 30 | /** 31 | * Use this flag to specify the flip presentation model and to specify that DXGI discard the contents of the back buffer after you call IDXGISwapChain1::Present1. 32 | * This flag cannot be used with multisampling and partial presentation. 33 | * Direct3D 11: This enumeration value is supported starting with Windows 10. 34 | * DXGI_SWAP_EFFECT_FLIP_DISCARD 35 | */ 36 | FlipDiscard = 4 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/Usage.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | /** 4 | * Flags for surface and resource creation options. 5 | * DXGI_USAGE 6 | */ 7 | public enum Usage : uint32 8 | { 9 | /** 10 | * Use the surface or resource as an input to a shader. 11 | * DXGI_USAGE_SHADER_INPUT 12 | */ 13 | ShaderInput = 0x00000010UL, 14 | /** 15 | * Use the surface or resource as an output render target. 16 | * DXGI_USAGE_RENDER_TARGET_OUTPUT 17 | */ 18 | RenderTargetOutput = 0x00000020UL, 19 | /** 20 | * The surface or resource is used as a back buffer. 21 | * You don’t need to pass BackBuffer (DXGI_USAGE_BACK_BUFFER) when you create a swap chain. 22 | * But you can determine whether a resource belongs to a swap chain when you call IDXGIResource::GetUsage and get BackBuffer (DXGI_USAGE_BACK_BUFFER). 23 | * DXGI_USAGE_BACK_BUFFER 24 | */ 25 | BackBuffer = 0x00000040UL, 26 | /** 27 | * Share the surface or resource. 28 | * DXGI_USAGE_SHARED 29 | */ 30 | Shared = 0x00000080UL, 31 | /** 32 | * Use the surface or resource for reading only. 33 | * DXGI_USAGE_READ_ONLY 34 | */ 35 | ReadOnly = 0x00000100UL, 36 | /** 37 | * This flag is for internal use only. 38 | * DXGI_USAGE_DISCARD_ON_PRESENT 39 | */ 40 | DiscardOnPresent = 0x00000200UL, 41 | /** 42 | * Use the surface or resource for unordered access. 43 | * DXGI_USAGE_UNORDERED_ACCESS 44 | */ 45 | UnorderedAccess = 0x00000400UL, 46 | /** 47 | * No usage flags specified. 48 | */ 49 | None = 0 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DirectX/src/DXGI/WindowAssociationFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.DXGI 2 | { 3 | public enum WindowAssociationFlags : uint32 4 | { 5 | /** 6 | Prevent DXGI from monitoring an applications message queue; 7 | this makes DXGI unable to respond to mode changes. 8 | DXGI_MWA_NO_WINDOW_CHANGES 9 | */ 10 | NoWindowChanges = 1, // 1 << 0 11 | /** 12 | Prevent DXGI from responding to an alt-enter sequence. 13 | DXGI_MWA_NO_ALT_ENTER 14 | */ 15 | NoAltEnter = 2, // 1 << 1 16 | /** 17 | Prevent DXGI from responding to a print-screen key. 18 | DXGI_MWA_NO_PRINT_SCREEN 19 | */ 20 | NoPrintScreen = 4, // 1 << 2 21 | Valid = 7, // 0x7 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DirectX/src/DirectX.bf: -------------------------------------------------------------------------------- 1 | using DirectX.Common; 2 | 3 | namespace DirectX 4 | { 5 | public typealias SIZE_T = uint; 6 | 7 | public typealias LPSTR = char8*; 8 | 9 | public typealias UINT = uint32; 10 | public typealias INT = int32; 11 | 12 | public typealias BOOL = BigBool; 13 | } 14 | -------------------------------------------------------------------------------- /DirectX/src/Math/MathUtil.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Math 4 | { 5 | public static class MathUtil 6 | { 7 | /// An optimal representation of π. 8 | public const float Pi = 3.141592654f; 9 | /// An optimal representation of 2*π. 10 | public const float TwoPi = 6.283185307f; 11 | /// An optimal representation of 1/π. 12 | public const float OneOverPi = 0.318309886f; 13 | /// An optimal representation of 2/π. 14 | public const float OneOverTwoPi = 0.159154943f; 15 | /// An optimal representation of π/2. 16 | public const float PiOverTwo = 1.570796327f; 17 | /// An optimal representation of π/4. 18 | public const float PiOverFour = 0.785398163f; 19 | 20 | /** 21 | * Converts radians to degrees. 22 | * @param radians The value to convert. 23 | * @return The converted value. 24 | */ 25 | [Inline] 26 | public static float RadiansToDegrees(float radians) => radians * (180.0f / Pi); 27 | 28 | /** 29 | * Converts degrees to radians. 30 | * @param radians The value to convert. 31 | * @return The converted value. 32 | */ 33 | [Inline] 34 | public static float DegreesToRadians(float degrees) => degrees * (Pi / 180f); 35 | 36 | /** 37 | * Converts radians to revolutions. 38 | * @param radians The value to convert. 39 | * @return The converted value. 40 | */ 41 | [Inline] 42 | public static float RadiansToRevolutions(float radians) => radians * OneOverTwoPi; 43 | 44 | /** 45 | * Converts revolutions to radians. 46 | * @param radians The value to convert. 47 | * @return The converted value. 48 | */ 49 | [Inline] 50 | public static float RevolutionsToRadians(float revolutions) => revolutions * TwoPi; 51 | 52 | /** 53 | * Converts degrees to revolutions. 54 | * @param radians The value to convert. 55 | * @return The converted value. 56 | */ 57 | [Inline] 58 | public static float DegreesToRevolutions(float degrees) => degrees * (1.0f / 360f); 59 | 60 | /** 61 | * Converts revolutions to degrees. 62 | * @param radians The value to convert. 63 | * @return The converted value. 64 | */ 65 | [Inline] 66 | public static float RevolutionsToDegrees(float revolutions) => revolutions * 360f; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /DirectX/src/Math/Point.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Math 4 | { 5 | public struct Point 6 | { 7 | public uint32 X, Y; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DirectX/src/Math/Rectangle.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Math 4 | { 5 | /** 6 | * Represents a rectangle and provides convenience methods for creating rectangles. 7 | */ 8 | public struct Rectangle 9 | { 10 | public int32 Left; 11 | public int32 Top; 12 | public int32 Right; 13 | public int32 Bottom; 14 | 15 | /** 16 | * Instantiates a new instance of an uninitialized Rectangle structure. 17 | */ 18 | public this() 19 | { 20 | this = default; 21 | } 22 | 23 | /** 24 | * Instantiates a new instance of a Rectangle structure that is initialized with the dimensions of a rectangle. 25 | */ 26 | public this(int32 left, int32 top, int32 right, int32 bottom) 27 | { 28 | Left = left; 29 | Top = top; 30 | Right = right; 31 | Bottom = bottom; 32 | } 33 | 34 | [Inline] 35 | public static bool operator ==(Rectangle l, Rectangle r) 36 | { 37 | return l.Left == r.Left && l.Top == r.Top && l.Right == r.Right && l.Bottom == r.Bottom; 38 | } 39 | 40 | [Inline] 41 | public static bool operator !=(Rectangle l, Rectangle r) 42 | { 43 | return !(l == r); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Gdi32/Gdi32.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows.Gdi32 4 | { 5 | static 6 | { 7 | /** 8 | * The GetStockObject function retrieves a handle to one of the stock pens, brushes, fonts, or palettes. 9 | * 10 | * @param i The type of stock object. 11 | * 12 | * @return If the function succeeds, the return value is a handle to the requested logical object. 13 | * If the function fails, the return value is NULL. 14 | */ 15 | [Import("Gdi32.lib"), CallingConvention(.Stdcall), CLink] 16 | public static extern int GetStockObject(int32 i); 17 | 18 | /** 19 | * The CreateSolidBrush function creates a logical brush that has the specified solid color. 20 | * @param color The color of the brush. 21 | * @return If the function succeeds, the return value identifies a logical brush. 22 | * If the function fails, the return value is NULL. 23 | */ 24 | [Import("Gdi32.lib"), CallingConvention(.Stdcall), CLink] 25 | public static extern HBRUSH CreateSolidBrush(DWORD color); 26 | 27 | /** 28 | * The CreateSolidBrush function creates a logical brush that has the specified solid color. 29 | * @param r The red value of the color of the brush. 30 | * @param g The green value of the color of the brush. 31 | * @param b The blue value of the color of the brush. 32 | * @return If the function succeeds, the return value identifies a logical brush. 33 | * If the function fails, the return value is NULL. 34 | */ 35 | public static HBRUSH CreateSolidBrush(uint8 r, uint8 g, uint8 b) 36 | { 37 | uint32 dword = ((.)b << 16) | ((.)g << 8) | r; 38 | return CreateSolidBrush(dword); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DirectX/src/Windows/SecurityAttributes.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | /** 6 | * The SECURITY_ATTRIBUTES structure contains the security descriptor for an object and specifies whether the handle retrieved by specifying this structure is inheritable. 7 | */ 8 | [CRepr] 9 | public struct SecurityAttributes 10 | { 11 | /** 12 | * The size, in bytes, of this structure. 13 | * Set this value to the size of the SecurityAttributes structure. 14 | */ 15 | public DWORD Length; 16 | /** 17 | * A pointer to a SECURITY_DESCRIPTOR structure that controls access to the object. 18 | */ 19 | public LPVOID SecurityDescriptor; 20 | /** 21 | * A Boolean value that specifies whether the returned handle is inherited when a new process is created. 22 | * If this member is TRUE, the new process inherits the handle. 23 | */ 24 | public BOOL InheritHandle; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/HandleMessageFlags.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | * Specifies how messages are to be handled. 5 | */ 6 | public enum HandleMessageFlags : UINT 7 | { 8 | /** 9 | * Messages are not removed from the queue after processing by PeekMessage. 10 | * PM_NOREMOVE 11 | */ 12 | NoRemove = 0, 13 | /** 14 | * Messages are removed from the queue after processing by PeekMessage. 15 | * PM_REMOVE 16 | */ 17 | Remove = 1, 18 | /** 19 | * Prevents the system from releasing any thread that is waiting for the caller to go idle (see WaitForInputIdle). 20 | * Combine this value with either NoRemove or Remove. 21 | * PM_NOYIELD 22 | */ 23 | NoYield = 2 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/ImageType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | * The type of image to be loaded. 5 | */ 6 | public enum ImageType : UINT 7 | { 8 | /** 9 | * Loads a bitmap. 10 | * IMAGE_BITMAP 11 | */ 12 | Bitmap = 0, 13 | /** 14 | * Loads an icon. 15 | * IMAGE_ICON 16 | */ 17 | Icon = 1, 18 | /** 19 | * Loads a cursor. 20 | * IMAGE_CURSOR 21 | */ 22 | Cursor = 2 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/Message.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | typealias LPMSG = Message*; 6 | 7 | [CRepr] 8 | public struct Message 9 | { 10 | public HWND hwnd; 11 | public UINT message; 12 | public WPARAM wParam; 13 | public LPARAM lParam; 14 | public DWORD time; 15 | public POINT pt; 16 | } 17 | 18 | public struct POINT 19 | { 20 | public LONG x; 21 | public LONG y; 22 | 23 | public this() => this = default; 24 | 25 | public this(LONG x, LONG y) 26 | { 27 | this.x = x; 28 | this.y = y; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxButtons.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | /// Indicates the buttons displayed in the message box. 6 | public enum MessageBoxButtons : UINT 7 | { 8 | /** 9 | The message box contains one push button: OK. This is the default. 10 | MB_OK 11 | */ 12 | Ok = 0x00000000L, 13 | /** 14 | The message box contains two push buttons: OK and Cancel. 15 | MB_OKCANCEL 16 | */ 17 | OkCancel = 0x00000001L, 18 | /** 19 | The message box contains three push buttons: Abort, Retry, and Ignore. 20 | MB_ABORTRETRYIGNORE 21 | */ 22 | AbortRetryIgnore = 0x00000002L, 23 | /** 24 | The message box contains three push buttons: Yes, No, and Cancel. 25 | MB_YESNOCANCEL 26 | */ 27 | YesNoCancel = 0x00000003L, 28 | /** 29 | The message box contains two push buttons: Yes and No. 30 | MB_YESNO 31 | */ 32 | YesNo = 0x00000004L, 33 | /** 34 | The message box contains two push buttons: Retry and Cancel. 35 | MB_RETRYCANCEL 36 | */ 37 | RetryCancel = 0x00000005L, 38 | /** 39 | The message box contains three push buttons: Cancel, Try Again, Continue. 40 | Use this message box type instead of AbortRetryIgnore (MB_ABORTRETRYIGNORE). 41 | MB_CANCELTRYCONTINUE 42 | */ 43 | CancelTryContinue = 0x00000006L, 44 | /** 45 | Adds a Help button to the message box. 46 | When the user clicks the Help button or presses F1, the system sends a WM_HELP message to the owner. 47 | MB_HELP 48 | */ 49 | Help = 0x00004000L, 50 | } 51 | } -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxDefaultButton.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | Indicates the default button of the message box. 5 | */ 6 | public enum MessageBoxDefaultButton : UINT 7 | { 8 | /** 9 | The first button is the default button. 10 | 11 | (Button1) MB_DEFBUTTON1 is the default unless (Button2)MB_DEFBUTTON2, (Button3)MB_DEFBUTTON3, or (Button4)MB_DEFBUTTON4 is specified. 12 | MB_DEFBUTTON1 13 | */ 14 | Button1 = 0x00000000L, 15 | /** 16 | The second button is the default button. 17 | MB_DEFBUTTON2 18 | */ 19 | Button2 = 0x00000100L, 20 | /** 21 | The third button is the default button. 22 | MB_DEFBUTTON3 23 | */ 24 | Button3 = 0x00000200L, 25 | /** 26 | The fourth button is the default button. 27 | MB_DEFBUTTON4 28 | */ 29 | Button4 = 0x00000300L, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxIcon.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | /// Indicates the icon displayed in the message box. 6 | [AllowDuplicates] 7 | public enum MessageBoxIcon : UINT 8 | { 9 | None = 0, 10 | /** 11 | A stop-sign icon appears in the message box. 12 | MB_ICONHAND 13 | */ 14 | Hand = 0x00000010L, 15 | /** 16 | A question-mark icon appears in the message box. 17 | The question-mark message icon is no longer recommended because it does not clearly represent a specific type of message and because the phrasing of a message as a question could apply to any message type. 18 | In addition, users can confuse the message symbol question mark with Help information. 19 | Therefore, do not use this question mark message symbol in your message boxes. 20 | The system continues to support its inclusion only for backward compatibility. 21 | MB_ICONQUESTION 22 | */ 23 | Question = 0x00000020L, 24 | /** 25 | An exclamation-point icon appears in the message box. 26 | MB_ICONEXCLAMATION 27 | */ 28 | Exclamation = 0x00000030L, 29 | /** 30 | An icon consisting of a lowercase letter i in a circle appears in the message box. 31 | MB_ICONASTERISK 32 | */ 33 | Asterisk = 0x00000040L, 34 | /** 35 | An exclamation-point icon appears in the message box. 36 | MB_ICONWARNING 37 | */ 38 | Warning = Exclamation, 39 | /** 40 | An icon consisting of a lowercase letter i in a circle appears in the message box. 41 | MB_ICONINFORMATION 42 | */ 43 | Information = Asterisk, 44 | /** 45 | A stop-sign icon appears in the message box. 46 | MB_ICONSTOP 47 | */ 48 | Stop = Hand, 49 | /** 50 | MB_USERICON 51 | */ 52 | UserIcon = 0x00000080L, 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxModality.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | public enum MessageBoxModality : UINT 4 | { 5 | /** 6 | The user must respond to the message box before continuing work in the window identified by the hWnd parameter. However, the user can move to the windows of other threads and work in those windows. 7 | 8 | Depending on the hierarchy of windows in the application, the user may be able to move to other windows within the thread. All child windows of the parent of the message box are automatically disabled, but pop-up windows are not. 9 | 10 | MB_APPLMODAL is the default if neither MB_SYSTEMMODAL nor MB_TASKMODAL is specified. 11 | MB_APPLMODAL 12 | */ 13 | Application = 0x00000000L, 14 | /** 15 | Same as MB_APPLMODAL except that the message box has the WS_EX_TOPMOST style. Use system-modal message boxes to notify the user of serious, potentially damaging errors that require immediate attention (for example, running out of memory). This flag has no effect on the user's ability to interact with windows other than those associated with hWnd. 16 | */ 17 | System = 0x00001000L, 18 | /** 19 | Same as MB_APPLMODAL except that all the top-level windows belonging to the current thread are disabled if the hWnd parameter is NULL. Use this flag when the calling application or library does not have a window handle available but still needs to prevent input to other windows in the calling thread without suspending other threads. 20 | */ 21 | Task = 0x00002000L 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxOptions.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | Specifies message box options. 5 | */ 6 | public enum MessageBoxOptions : UINT 7 | { 8 | None = 0, 9 | /** 10 | Same as desktop of the interactive window station. For more information, see Window Stations. 11 | 12 | If the current input desktop is not the default desktop, MessageBox does not return until the user switches to the default desktop. 13 | MB_DEFAULT_DESKTOP_ONLY 14 | */ 15 | DefaultDesktopOnly = 0x00020000L, 16 | /** 17 | The text is right-justified. 18 | MB_RIGHT 19 | */ 20 | RightJustified = 0x00080000L, 21 | /** 22 | Displays message and caption text using right-to-left reading order on Hebrew and Arabic systems. 23 | MB_RTLREADING 24 | */ 25 | RightToLeftReading = 0x00100000L, 26 | /** 27 | The message box becomes the foreground window. Internally, the system calls the SetForegroundWindow function for the message box. 28 | MB_SETFOREGROUND 29 | */ 30 | SetForeground = 0x00010000L, 31 | /** 32 | The message box is created with the WS_EX_TOPMOST window style. 33 | MB_TOPMOST 34 | */ 35 | TopMost = 0x00040000L, 36 | /** 37 | The caller is a service notifying the user of an event. The function displays a message box on the current active desktop, even if there is no user logged on to the computer. 38 | 39 | Terminal Services: If the calling thread has an impersonation token, the function directs the message box to the session specified in the impersonation token. 40 | 41 | If this flag is set, the hWnd parameter must be NULL. This is so that the message box can appear on a desktop other than the desktop corresponding to the hWnd. 42 | 43 | For information on security considerations in regard to using this flag, see Interactive Services. In particular, be aware that this flag can produce interactive content on a locked desktop and should therefore be used for only a very limited set of scenarios, such as resource exhaustion. 44 | MB_SERVICE_NOTIFICATION 45 | */ 46 | ServiceNotification = 0x00200000L 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MessageBoxResult.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | The message box button that has been pressed. 5 | */ 6 | public enum MessageBoxResult : UINT 7 | { 8 | /** 9 | The OK button was selected. 10 | */ 11 | Ok = 1, 12 | /** 13 | The Cancel button was selected. 14 | */ 15 | Cancel = 2, 16 | /** 17 | The Abort button was selected. 18 | */ 19 | Abort = 3, 20 | /** 21 | The Retry button was selected. 22 | */ 23 | Retry = 4, 24 | /** 25 | The Ignore button was selected. 26 | */ 27 | Ignore = 5, 28 | /** 29 | The Yes button was selected. 30 | */ 31 | Yes = 6, 32 | /** 33 | The No button was selected. 34 | */ 35 | No = 7, 36 | /** 37 | The Try Again button was selected. 38 | */ 39 | TryAgain = 10, 40 | /** 41 | The Continue button was selected. 42 | */ 43 | Continue = 11, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/MinMaxInfo.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | /** 6 | * Contains information about a window's maximized size and position and its minimum and maximum tracking size. 7 | */ 8 | [CRepr] 9 | public struct MinMaxInfo 10 | { 11 | /** 12 | * Reserved; do not use. 13 | */ 14 | private POINT ptReserved; 15 | /** 16 | * The maximized width (x member) and the maximized height (y member) of the window. 17 | * For top-level windows, this value is based on the width of the primary monitor. 18 | */ 19 | public POINT MaximizedSize; 20 | /** 21 | * The position of the left side of the maximized window (x member) 22 | * and the position of the top of the maximized window (y member). 23 | * For top-level windows, this value is based on the position of the primary monitor. 24 | */ 25 | public POINT MaximizedPosition; 26 | /** 27 | * The minimum tracking width (x member) and the minimum tracking height (y member) of the window. 28 | * This value can be obtained programmatically from the system metrics SM_CXMINTRACK and SM_CYMINTRACK (see the GetSystemMetrics function). 29 | */ 30 | public POINT MinimumTrackingSize; 31 | /** 32 | * The maximum tracking width (x member) and the maximum tracking height (y member) of the window. 33 | * This value is based on the size of the virtual screen and can be obtained programmatically 34 | * from the system metrics SM_CXMAXTRACK and SM_CYMAXTRACK (see the GetSystemMetrics function). 35 | */ 36 | public POINT MaximumTrackingSize; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/RAWINPUTDEVICE.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows.Winuser 4 | { 5 | /** 6 | * Defines information for the raw input devices. 7 | */ 8 | [CRepr] 9 | public struct RAWINPUTDEVICE 10 | { 11 | public uint16 UsagePage; 12 | public uint16 Usage; 13 | public uint32 Flags; 14 | public Windows.HWnd Target; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/RAWINPUTHEADER.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows.Winuser 4 | { 5 | /** 6 | * Contains the header information that is part of the raw input data. 7 | */ 8 | [CRepr] 9 | public struct RAWINPUTHEADER 10 | { 11 | /** 12 | * The type of raw input. 13 | * It can be one of the RIM_TYPE-values. 14 | */ 15 | public DWORD Type; 16 | /** 17 | * The size, in bytes, of the entire input packet of data. 18 | * This includes RAWINPUT plus possible extra input reports in the RAWHID variable length array. 19 | */ 20 | public DWORD Size; 21 | /** 22 | * A handle to the device generating the raw input data. 23 | */ 24 | public HANDLE Device; 25 | /** 26 | * The value passed in the wParam parameter of the WM_INPUT message. 27 | */ 28 | public WPARAM WParam; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/ResizingType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Windows 2 | { 3 | /** 4 | * The type of resizing requested. 5 | * (The WParam for the Size (WM_SIZE) window notification.) 6 | */ 7 | public enum ResizingType : WPARAM 8 | { 9 | /** 10 | * The window has been resized, but neither the Minimized (SIZE_MINIMIZED) nor Maximized (SIZE_MAXIMIZED) value applies. 11 | * SIZE_RESTORED 12 | */ 13 | Restored = 0, 14 | /** 15 | * The window has been minimized. 16 | * SIZE_MINIMIZED 17 | */ 18 | Minimized = 1, 19 | /** 20 | * The window has been maximized. 21 | * SIZE_MAXIMIZED 22 | */ 23 | Maximized = 2, 24 | /** 25 | * Message is sent to all pop-up windows when some other window has been restored to its former size. 26 | */ 27 | MaxShow = 3, 28 | /** 29 | * Message is sent to all pop-up windows when some other window is maximized. 30 | */ 31 | MaxHide = 4, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DirectX/src/Windows/Winuser/WindowClassW.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.Windows 4 | { 5 | typealias WNDCLASSW = WindowClassW; 6 | typealias WNDCLASS = WNDCLASSW; 7 | 8 | [CRepr] 9 | public struct WindowClassW 10 | { 11 | public WindowClassStyles style; 12 | public WNDPROC lpfnWndProc; 13 | public int32 cbClsExtra; 14 | public int32 cbWndExtra; 15 | public HINSTANCE hInstance; 16 | public HICON hIcon; 17 | public HCURSOR hCursor; 18 | public HBRUSH hbrBackground; 19 | public LPCWSTR lpszMenuName; 20 | public LPCWSTR lpszClassName; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/Buffer.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Represents an audio data buffer, used with IXAudio2SourceVoice.SubmitSourceBuffer. 7 | */ 8 | [CRepr] 9 | public struct XAudio2Buffer 10 | { 11 | public enum Flags : uint32 12 | { 13 | /** 14 | * No flags specified. 15 | */ 16 | None = 0, 17 | /** 18 | * Indicates that there cannot be any buffers in the queue after this buffer. The only effect of this flag is to suppress debug output warnings caused by starvation of the buffer queue. 19 | * @native XAUDIO2_END_OF_STREAM 20 | */ 21 | EndOfStream = 0x0040 22 | } 23 | 24 | /** 25 | * Flags that provide additional information about the audio buffer. 26 | */ 27 | public Flags Flags; 28 | /** 29 | * Size of the audio data, in bytes. 30 | */ 31 | public uint32 AudioBytes; 32 | /** 33 | * Pointer to the audio data. 34 | */ 35 | public uint8 *pAudioData; 36 | /** 37 | * First sample in the buffer that should be played. 38 | */ 39 | public uint32 PlayBegin; 40 | /** 41 | * Length of the region to be played, in samples. 42 | */ 43 | public uint32 PlayLength; 44 | /** 45 | * First sample of the region to be looped. 46 | */ 47 | public uint32 LoopBegin; 48 | /** 49 | * Length of the loop region, in samples. 50 | */ 51 | public uint32 LoopLength; 52 | /** 53 | * umber of times to loop through the loop region. 54 | */ 55 | public uint32 LoopCount; 56 | /** 57 | * Context value to be passed back in callbacks to the client. This may be NULL. 58 | */ 59 | public void *pContext; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/BufferWMA.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Used with IXAudio2SourceVoice::SubmitSourceBuffer when submitting xWMA data. 7 | */ 8 | [CRepr] 9 | public struct BufferWMA 10 | { 11 | /** 12 | * Decoded packet cumulative data size array, each element is the number of bytes accumulated after the corresponding xWMA packet is decoded in order, must have PacketCount elements. 13 | */ 14 | public uint32* DecodedPacketComulativeBytes; 15 | /** 16 | * Number of xWMA packets submitted, must be >= 1 and divide evenly into the respective XAudio2Buffer.AudioBytes value passed to IXAudio2SourceVoice::SubmitSourceBuffer. 17 | */ 18 | public uint32 PackedCount; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/DebugConfiguration.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace DirectX.XAudio2 3 | { 4 | /** 5 | * Contains the new global debug configuration for XAudio2. Used with the SetDebugConfiguration function. 6 | * @native XAUDIO2_DEBUG_CONFIGURATION 7 | */ 8 | [CRepr] 9 | public struct DebugConfiguration 10 | { 11 | /** 12 | * Bitmask of enabled debug message types. 13 | * Can be any combination of the TraceMask-flags. 14 | */ 15 | public TraceMask TraceMask; 16 | /** 17 | * Message types that will cause an immediate break. 18 | * Can be any combination of the TraceMask-flags. 19 | */ 20 | public BreakMask BreakMask; 21 | /** 22 | * Indicates whether to log the thread ID with each message. 23 | */ 24 | public BOOL LogThreadID; 25 | /** 26 | * Indicates whether to log source files and line numbers. 27 | */ 28 | public BOOL LogFileline; 29 | /** 30 | * Indicates whether to log function names. 31 | */ 32 | public BOOL LogFunctionName; 33 | /** 34 | * Indicates whether to log message timestamps. 35 | */ 36 | public BOOL LogTiming; 37 | 38 | public this() => this = default; 39 | 40 | public this(TraceMask traceMask = .None, BreakMask breakMask = .None) : this() 41 | { 42 | TraceMask = traceMask; 43 | BreakMask = breakMask; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/EffectChain.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Defines an effect chain. 7 | */ 8 | [CRepr] 9 | public struct EffectChain 10 | { 11 | /** 12 | * Number of effects in the effect chain for the voice. 13 | */ 14 | public uint32 EffectCount; 15 | /** 16 | * Array of EffectDescriptor structures containing pointers to XAPO instances. 17 | */ 18 | public EffectDescriptor* EffectDescriptors; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/EffectDescriptor.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.XAudio2 5 | { 6 | /** 7 | * Contains information about and XAPO for use in an effect chain. 8 | */ 9 | [CRepr] 10 | public struct EffectDescriptor 11 | { 12 | /** 13 | * Pointer to the IUnknown interface of the XAPO object. 14 | */ 15 | public IUnknown* Effect; 16 | /** 17 | * TRUE if the effect should begin in the enabled state; FALSE otherwise. 18 | */ 19 | public BOOL InitialState; 20 | /** 21 | * Number of output channels the effect should produce. 22 | */ 23 | public uint32 OutputChannels; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/ErrorCodes.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.Common 2 | { 3 | /** 4 | * XAudio2 specific error codes returned by XAudio2 methods. 5 | */ 6 | public extension HResult 7 | { 8 | /** 9 | * Returned by XAudio2 for certain API usage errors (invalid calls and so on) that are hard to avoid completely and should be handled by a title at runtime. 10 | * (API usage errors that are completely avoidable, such as invalid parameters, cause an ASSERT in debug builds and undefined behavior in retail builds, so no error code is defined for them.) 11 | */ 12 | public const HResult XAUDIO2_E_INVALID_CALL = (HResult)0x88960001; 13 | /** 14 | * The Xbox 360 XMA hardware suffered an unrecoverable error. 15 | */ 16 | public const HResult XAUDIO2_E_XMA_DECODER_ERROR = (HResult)0x88960002; 17 | /** 18 | * An effect failed to instantiate. 19 | */ 20 | public const HResult XAUDIO2_E_XAPO_CREATION_FAILED = (HResult)0x88960003; 21 | /** 22 | * An audio device became unusable through being unplugged or some other event. 23 | */ 24 | public const HResult XAUDIO2_E_DEVICE_INVALIDATED = (HResult)0x88960004; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/FilterParameters.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Defines filter parameters for a source voice. 7 | */ 8 | [CRepr] 9 | public struct FilterParameters 10 | { 11 | /** 12 | * The FilterType. 13 | */ 14 | public FilterType Type; 15 | /** 16 | * Filter radian frequency calculated as (2 * sin(pi * (desired filter cutoff frequency) / sampleRate)). 17 | * The frequency must be greater than or equal to 0 and less than or equal to XAudio2.MaxFilterFrequency. 18 | */ 19 | public float Frequency; 20 | /** 21 | * Reciprocal of Q factor. 22 | * Must be greater than 0 and less than or equal to XAudio2.MaxOneOverQ. 23 | */ 24 | public float OneOverQ; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/FilterType.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.XAudio2 2 | { 3 | /** 4 | * Indicates the filter type. 5 | */ 6 | public enum FilterType : uint32 7 | { 8 | /** 9 | * Attenuates (reduces) frequencies above the cutoff frequency. 10 | */ 11 | LowPassFilter, 12 | /** 13 | * Attenuates frequencies outside a given range. 14 | */ 15 | BandPassFilter, 16 | /** 17 | * Attenuates frequencies below the cutoff frequency. 18 | */ 19 | HighPassFilter, 20 | /** 21 | * Attenuates frequencies inside a given range. 22 | */ 23 | NotchFilter, 24 | /** 25 | * Attenuates frequencies above the cutoff frequency. This is a one-pole filter, and FilterParameters.OneOverQ has no effect. 26 | */ 27 | LowPassOnePoleFilter, 28 | /** 29 | * Attenuates frequencies below the cutoff frequency. This is a one-pole filter, and FilterParameters.OneOverQ has no effect. 30 | */ 31 | HighPassOnePoleFilter 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/IXAudio2MasteringVoice.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.XAudio2 5 | { 6 | /** 7 | * A submix voice is used primarily for performance improvements and effects processing. 8 | */ 9 | public struct IXAudio2MasteringVoice : IXAudio2Voice 10 | { 11 | public struct VTable : IXAudio2Voice.VTable 12 | { 13 | public function [CallingConvention(.Stdcall)] HResult(IXAudio2MasteringVoice *self, int32 *pChannelmask) GetChannelMask; 14 | } 15 | 16 | public new VTable* VT 17 | { 18 | [Inline] 19 | get => (.)mVT; 20 | } 21 | 22 | /** 23 | * Returns the channel mask for this voice. 24 | * @param channelMask Returns the channel mask for this voice. This corresponds to the dwChannelMask member of the WAVEFORMATEXTENSIBLE structure. 25 | */ 26 | public HResult GetChannelMask(out int32 channelMask) mut 27 | { 28 | channelMask = ?; 29 | return VT.GetChannelMask(&this, &channelMask); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/IXAudio2SourceVoice.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX.Common; 3 | 4 | namespace DirectX.XAudio2 5 | { 6 | /** 7 | * A submix voice is used primarily for performance improvements and effects processing. 8 | */ 9 | public struct IXAudio2SourceVoice : IXAudio2Voice 10 | { 11 | public struct VTable : IXAudio2Voice.VTable 12 | { 13 | // Todo: 14 | public function [CallingConvention(.Stdcall)] HResult(IXAudio2SourceVoice *self, uint32 Flags, uint32 OperationSet) Start; 15 | public function [CallingConvention(.Stdcall)] HResult(IXAudio2SourceVoice *self) Stop; 16 | public function [CallingConvention(.Stdcall)] HResult(IXAudio2SourceVoice *self, XAudio2Buffer *pBuffer, BufferWMA *pBufferWNA) SubmitSourceBuffer; 17 | } 18 | 19 | public new VTable* VT 20 | { 21 | [Inline] 22 | get => (.)mVT; 23 | } 24 | /* 25 | /** 26 | * Returns the channel mask for this voice. 27 | * @param channelMask Returns the channel mask for this voice. This corresponds to the dwChannelMask member of the WAVEFORMATEXTENSIBLE structure. 28 | */ 29 | public HResult GetChannelMask(out int32 channelMask) mut 30 | { 31 | channelMask = ?; 32 | return VT.GetChannelMask(&this, &channelMask); 33 | } 34 | */ 35 | 36 | public HResult Start(uint32 flags = 0, uint32 operationSet = XAudio2.CommitNow) mut 37 | { 38 | return VT.Start(&this, flags, operationSet); 39 | } 40 | 41 | /** 42 | * Adds a new audio buffer to the voice queue. 43 | * @param buffer 44 | * @param bufferVMA 45 | */ 46 | public HResult SubmitSourceBuffer(ref XAudio2Buffer buffer, BufferWMA* bufferWMA = null) mut 47 | { 48 | return VT.SubmitSourceBuffer(&this, &buffer, bufferWMA); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/IXAudio2SubmixVoice.bf: -------------------------------------------------------------------------------- 1 | namespace DirectX.XAudio2 2 | { 3 | /** 4 | * A submix voice is used primarily for performance improvements and effects processing. 5 | */ 6 | public struct IXAudio2SubmixVoice : IXAudio2Voice { } 7 | } 8 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/VoiceDetails.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Contains information about the creation flags, input channels, and sample rate of a voice. 7 | * @native XAUDIO2_VOICE_DETAILS 8 | */ 9 | [CRepr] 10 | public struct VoiceDetails 11 | { 12 | /** 13 | * Flags used to create the voice; see the individual voice interfaces for more information. 14 | */ 15 | public uint32 CreationFlags; // Todo: enumerate flags 16 | /** 17 | * Flags that are currently set on the voice. 18 | */ 19 | public uint32 ActiveFlags; // Todo: enumerate flags 20 | /** 21 | * The number of input channels the voice expects. 22 | */ 23 | public uint32 InputChannels; 24 | /** 25 | * The input sample rate the voice expects. 26 | */ 27 | public uint32 InputSampleRate; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DirectX/src/XAudio2/VoiceSendList.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DirectX.XAudio2 4 | { 5 | /** 6 | * Defines a set of voices to receive data from a single output voice. 7 | * @native XAUDIO2_VOICE_SENDS 8 | */ 9 | [CRepr] 10 | public struct VoiceSends 11 | { 12 | /** 13 | * Number of voices to receive the output of the voice. An OutputCount value of 0 indicates the voice should not send output to any voices. 14 | */ 15 | public uint32 SendCount; 16 | /** 17 | * Array of SendDescriptor structures describing destination voices and the filters that should be used when sending to the voices. 18 | * This array should contain SendCount elements. If SendCount is 0 Sends should be NULL. Note that Sends cannot contain the same voice more than once. 19 | */ 20 | public SendDescriptor* Sends; 21 | 22 | public this() => this = default; 23 | 24 | public this(Span sends) 25 | { 26 | Sends = sends.Ptr; 27 | SendCount = (uint32)sends.Length; 28 | } 29 | } 30 | 31 | public enum SendFlags : uint32 32 | { 33 | /** 34 | * No flags specified. 35 | */ 36 | None = 0, 37 | /** 38 | * @native XAUDIO2_SEND_USEFILTER 39 | */ 40 | UseFilter = 0x0080 41 | } 42 | 43 | /** 44 | * Defines a destination voice that is the target of a send from another voice and specifies whether a filter should be used. 45 | * @native XAUDIO2_SEND_DESCRIPTOR 46 | */ 47 | [CRepr] 48 | public struct SendDescriptor 49 | { 50 | /** 51 | * Indicates whether a filter should be used on data sent to the voice pointed to by OutputVoice. Flags can be 0 or XAUDIO2_SEND_USEFILTER. 52 | */ 53 | public SendFlags Flags; 54 | /** 55 | * A pointer to an IXAudio2Voice that will be the target of the send. The OutputVoice member cannot be NULL. 56 | */ 57 | public IXAudio2Voice* OutputVoice; 58 | 59 | public this() => this = default; 60 | 61 | public this(IXAudio2Voice* outputVoice, SendFlags flags = .None) 62 | { 63 | OutputVoice = outputVoice; 64 | Flags = flags; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/BeefProj.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Dependencies = {corlib = "*", DirectX = "*"} 3 | 4 | [Project] 5 | Name = "SimpleTriangleExample" 6 | TargetType = "BeefGUIApplication" 7 | StartupObject = "SimpleTriangleExample.Program" 8 | 9 | [Configs.Debug.Win64] 10 | PreBuildCmds = ["CopyFilesIfNewer(\"$(ProjectDir)/content\", \"$(BuildDir)\")"] 11 | -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/BeefSpace.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Projects = {SimpleTriangleExample = {Path = "."}, DirectX = {Path = "../../../DirectX"}} 3 | 4 | [Workspace] 5 | StartupProject = "SimpleTriangleExample" 6 | -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/content/basicShader.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_IN 2 | { 3 | float3 Position : POSITION; 4 | float4 Color : COLOR; 5 | }; 6 | 7 | struct PS_IN 8 | { 9 | float4 Position : SV_POSITION; 10 | float4 Color : COLOR; 11 | }; 12 | 13 | PS_IN VS(VS_IN input) 14 | { 15 | PS_IN output; 16 | output.Position = float4(input.Position, 1); 17 | output.Color = input.Color; 18 | 19 | return output; 20 | } 21 | 22 | float4 PS(PS_IN input) : SV_TARGET 23 | { 24 | return input.Color; 25 | } -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/content/directx.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aharabada/directx-beef/65f5bbbf01483f8c7699c8a1043cbbe6d6e16d9c/Examples/D3D11/SimpleTriangleExample/content/directx.ico -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/src/GameTime.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace SimpleTriangleExample 5 | { 6 | /** 7 | * A timer providing functionality to meassure frame times and game runtime. 8 | */ 9 | public class GameTime : Stopwatch 10 | { 11 | private uint64 _frameCount; 12 | 13 | private TimeSpan _totalTime; 14 | private TimeSpan _frameTime; 15 | 16 | /** 17 | The amount of time that has passed since the timer was started. 18 | */ 19 | public TimeSpan TotalTime => _totalTime; 20 | /** 21 | The amount of time that has passed since the start of the last frame. 22 | */ 23 | public TimeSpan FrameTime => _frameTime; 24 | /** 25 | The number of frames that have been computed since the timer was started. 26 | */ 27 | public uint64 FrameCount => _frameCount; 28 | 29 | private Stopwatch _stopWatch ~ delete _; 30 | 31 | public this() : base(){} 32 | 33 | /** 34 | * Initializes a new instance of a GameTime. 35 | * @param startNow If set to true, the timer will start immediately. 36 | * If set to false, the timer has to be started manually. 37 | */ 38 | public this(bool startNow) : base(startNow){} 39 | 40 | /** 41 | * Starts or continues the internal timer. 42 | */ 43 | public new void Start() 44 | { 45 | _stopWatch.Start(); 46 | } 47 | 48 | /** 49 | * Restarts the internal timer and resets the counters. 50 | */ 51 | public new void Restart() 52 | { 53 | _totalTime = 0; 54 | _frameTime = 0; 55 | _frameCount = 0; 56 | base.Restart(); 57 | } 58 | 59 | /** 60 | * Stops the internal timer. 61 | */ 62 | public new void Stop() 63 | { 64 | base.Stop(); 65 | } 66 | 67 | /** 68 | * Resets the timer. 69 | */ 70 | public new void Reset() 71 | { 72 | _totalTime = 0; 73 | _frameTime = 0; 74 | _frameCount = 0; 75 | base.Reset(); 76 | } 77 | 78 | /** 79 | * Tells the timer that a frame has passed and updates the counters. 80 | */ 81 | public void Tick() 82 | { 83 | TimeSpan old = _totalTime; 84 | _totalTime = Elapsed; 85 | _frameTime = _totalTime - old; 86 | 87 | _frameCount++; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Examples/D3D11/SimpleTriangleExample/src/VertexColor.bf: -------------------------------------------------------------------------------- 1 | using System; 2 | using DirectX; 3 | using DirectX.Math; 4 | 5 | namespace SimpleTriangleExample 6 | { 7 | /** 8 | * Represents a Vertex with a 3D-Position an a Color. 9 | */ 10 | [CRepr] 11 | public struct VertexColor 12 | { 13 | public Vector3 Position; 14 | public Color Color; 15 | 16 | public this(Vector3 position, Color color) 17 | { 18 | Position = position; 19 | Color = color; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Examples/XAudio2/CallbackExample/BeefProj.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Dependencies = {corlib = "*", DirectX = "*"} 3 | 4 | [Project] 5 | Name = "CallbackExample" 6 | StartupObject = "CallbackExample.Program" 7 | 8 | [Configs.Debug.Win64] 9 | PreBuildCmds = ["CopyFilesIfNewer(\"$(ProjectDir)/content\", \"$(BuildDir)\")"] 10 | -------------------------------------------------------------------------------- /Examples/XAudio2/CallbackExample/BeefSpace.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Projects = {CallbackExample = {Path = "."}, DirectX = {Path = "../../../DirectX"}} 3 | 4 | [Workspace] 5 | StartupProject = "CallbackExample" 6 | -------------------------------------------------------------------------------- /Examples/XAudio2/CallbackExample/content/testSound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aharabada/directx-beef/65f5bbbf01483f8c7699c8a1043cbbe6d6e16d9c/Examples/XAudio2/CallbackExample/content/testSound.wav -------------------------------------------------------------------------------- /Examples/XAudio2/SimpleAudioPlayback/BeefProj.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Dependencies = {corlib = "*", DirectX = "*"} 3 | 4 | [Project] 5 | Name = "SimpleAudioPlayback" 6 | StartupObject = "SimpleAudioPlayback.Program" 7 | 8 | [Configs.Debug.Win64] 9 | PreBuildCmds = ["CopyFilesIfNewer(\"$(ProjectDir)/content\", \"$(BuildDir)\")"] 10 | -------------------------------------------------------------------------------- /Examples/XAudio2/SimpleAudioPlayback/BeefSpace.toml: -------------------------------------------------------------------------------- 1 | FileVersion = 1 2 | Projects = {SimpleAudioPlayback = {Path = "."}, DirectX = {Path = "../../../DirectX"}} 3 | 4 | [Workspace] 5 | StartupProject = "SimpleAudioPlayback" 6 | -------------------------------------------------------------------------------- /Examples/XAudio2/SimpleAudioPlayback/content/testSound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aharabada/directx-beef/65f5bbbf01483f8c7699c8a1043cbbe6d6e16d9c/Examples/XAudio2/SimpleAudioPlayback/content/testSound.wav -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # directx-beef 2 | **directx-beef** is a wrapper library written in Beef for the **DirectX-API**. 3 | 4 | This wrapper also contains some basic bindings for the **WinAPI** so you can create windows for the DirectX applications. 5 | 6 | ## Notice: 7 | This wrapper is very unfinished. It only contains the interfaces and structures from **D3D11** and **DXGI**. 8 | 9 | Since there is a [project](https://github.com/blat-blatnik/BeefWin32) that prorvides bindings for (almost) the entire Win32-API it's unlikely that much work will be put into this wrapper. 10 | 11 | # Quick Start (Beef IDE) 12 | 1. **Download** directx-beef 13 | 2. **Copy** the *DirectX*-Folder into the *BeefLibs*-Directory (usualy `C:\Program Files\BeefLang\BeefLibs`) 14 | 3. Right-click your Workspace, click **Add from Installed...** and select **DirectX** 15 | 4. Add **DirectX** as dependency for your project 16 | 17 | There is also an example in this repository to demonstrate basic initialization and usage. 18 | 19 | # Credits 20 | Beef language website: https://www.beeflang.org 21 | 22 | Some (basically every non trivial) Vector and Matrix functions are from *Eric Lengyel's* books "Foundations of Game Engine Development" Volume 1 and 2 23 | --------------------------------------------------------------------------------