1 module aurora.directx.d2d1.d2d1effectauthor_0; 2 3 version(Windows): 4 5 public import aurora.directx.com; 6 public import aurora.directx.d2d1.d2d1_1; 7 8 //Callabcks 9 alias PD2D1_PROPERTY_SET_FUNCTION = extern(Windows) HRESULT delegate(IUnknown effect, const ubyte *data, uint dataSize); 10 alias PD2D1_PROPERTY_GET_FUNCTION = extern(Windows) HRESULT delegate(const IUnknown effect, ubyte *data, uint dataSize, uint *actualSize); 11 12 enum D2D1_CHANGE_TYPE 13 { 14 D2D1_CHANGE_TYPE_NONE = 0, 15 D2D1_CHANGE_TYPE_PROPERTIES = 1, 16 D2D1_CHANGE_TYPE_CONTEXT = 2, 17 D2D1_CHANGE_TYPE_GRAPH = 3, 18 D2D1_CHANGE_TYPE_FORCE_DWORD = 0xffffffff 19 } 20 21 enum D2D1_PIXEL_OPTIONS 22 { 23 D2D1_PIXEL_OPTIONS_NONE = 0, 24 D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1, 25 D2D1_PIXEL_OPTIONS_FORCE_DWORD = 0xffffffff 26 } 27 28 enum D2D1_VERTEX_OPTIONS 29 { 30 D2D1_VERTEX_OPTIONS_NONE = 0, 31 D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR = 1, 32 D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER = 2, 33 D2D1_VERTEX_OPTIONS_ASSUME_NO_OVERLAP = 4, 34 D2D1_VERTEX_OPTIONS_FORCE_DWORD = 0xffffffff 35 } 36 37 enum D2D1_VERTEX_USAGE 38 { 39 D2D1_VERTEX_USAGE_STATIC = 0, 40 D2D1_VERTEX_USAGE_DYNAMIC = 1, 41 D2D1_VERTEX_USAGE_FORCE_DWORD = 0xffffffff 42 } 43 44 enum D2D1_BLEND_OPERATION 45 { 46 D2D1_BLEND_OPERATION_ADD = 1, 47 D2D1_BLEND_OPERATION_SUBTRACT = 2, 48 D2D1_BLEND_OPERATION_REV_SUBTRACT = 3, 49 D2D1_BLEND_OPERATION_MIN = 4, 50 D2D1_BLEND_OPERATION_MAX = 5, 51 D2D1_BLEND_OPERATION_FORCE_DWORD = 0xffffffff 52 } 53 54 enum D2D1_BLEND 55 { 56 D2D1_BLEND_ZERO = 1, 57 D2D1_BLEND_ONE = 2, 58 D2D1_BLEND_SRC_COLOR = 3, 59 D2D1_BLEND_INV_SRC_COLOR = 4, 60 D2D1_BLEND_SRC_ALPHA = 5, 61 D2D1_BLEND_INV_SRC_ALPHA = 6, 62 D2D1_BLEND_DEST_ALPHA = 7, 63 D2D1_BLEND_INV_DEST_ALPHA = 8, 64 D2D1_BLEND_DEST_COLOR = 9, 65 D2D1_BLEND_INV_DEST_COLOR = 10, 66 D2D1_BLEND_SRC_ALPHA_SAT = 11, 67 D2D1_BLEND_BLEND_FACTOR = 14, 68 D2D1_BLEND_INV_BLEND_FACTOR = 15, 69 D2D1_BLEND_FORCE_DWORD = 0xffffffff 70 } 71 72 enum D2D1_CHANNEL_DEPTH 73 { 74 D2D1_CHANNEL_DEPTH_DEFAULT = 0, 75 D2D1_CHANNEL_DEPTH_1 = 1, 76 D2D1_CHANNEL_DEPTH_4 = 4, 77 D2D1_CHANNEL_DEPTH_FORCE_DWORD = 0xffffffff 78 } 79 80 enum D2D1_FILTER 81 { 82 D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00, 83 D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01, 84 D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, 85 D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05, 86 D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, 87 D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, 88 D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, 89 D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15, 90 D2D1_FILTER_ANISOTROPIC = 0x55, 91 D2D1_FILTER_FORCE_DWORD = 0xffffffff 92 } 93 94 enum D2D1_FEATURE 95 { 96 D2D1_FEATURE_DOUBLES = 0, 97 D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1, 98 D2D1_FEATURE_FORCE_DWORD = 0xffffffff 99 } 100 101 struct D2D1_PROPERTY_BINDING 102 { 103 const wchar *propertyName; 104 PD2D1_PROPERTY_SET_FUNCTION setFunction; 105 PD2D1_PROPERTY_GET_FUNCTION getFunction; 106 } 107 108 struct D2D1_RESOURCE_TEXTURE_PROPERTIES 109 { 110 const uint *extents; 111 uint dimensions; 112 D2D1_BUFFER_PRECISION bufferPrecision; 113 D2D1_CHANNEL_DEPTH channelDepth; 114 D2D1_FILTER filter; 115 const D2D1_EXTEND_MODE *extendModes; 116 } 117 118 struct D2D1_INPUT_ELEMENT_DESC 119 { 120 const char *semanticName; 121 uint semanticIndex; 122 DXGI_FORMAT format; 123 uint inputSlot; 124 uint alignedByteOffset; 125 } 126 127 enum D2D1_APPEND_ALIGNED_ELEMENT = 0xffffffff; 128 129 struct D2D1_VERTEX_BUFFER_PROPERTIES 130 { 131 uint inputCount; 132 D2D1_VERTEX_USAGE usage; 133 const ubyte *data; 134 uint byteWidth; 135 } 136 137 struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES 138 { 139 const byte *shaderBufferWithInputSignature; 140 uint shaderBufferSize; 141 const D2D1_INPUT_ELEMENT_DESC *inputElements; 142 uint elementCount; 143 uint stride; 144 } 145 146 struct D2D1_VERTEX_RANGE 147 { 148 uint startVertex; 149 uint vertexCount; 150 } 151 152 struct D2D1_BLEND_DESCRIPTION 153 { 154 D2D1_BLEND sourceBlend; 155 D2D1_BLEND destinationBlend; 156 D2D1_BLEND_OPERATION blendOperation; 157 D2D1_BLEND sourceBlendAlpha; 158 D2D1_BLEND destinationBlendAlpha; 159 D2D1_BLEND_OPERATION blendOperationAlpha; 160 float[4] blendFactor; 161 } 162 163 struct D2D1_INPUT_DESCRIPTION 164 { 165 D2D1_FILTER filter; 166 uint levelOfDetailCount; 167 } 168 169 struct D2D1_FEATURE_DATA_DOUBLES 170 { 171 bool doublePrecisionFloatShaderOps; 172 } 173 174 struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS 175 { 176 bool computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; 177 } 178 179 mixin(uuid!(ID2D1VertexBuffer, "9b8b1336-00a5-4668-92b7-ced5d8bf9b7b")); 180 public interface ID2D1VertexBuffer : IUnknown 181 { 182 extern(Windows): 183 HRESULT Map(ubyte **data, uint bufferSize); 184 HRESULT Unmap(); 185 } 186 187 mixin(uuid!(ID2D1ResourceTexture, "688d15c3-02b0-438d-b13a-d1b44c32c39a")); 188 public interface ID2D1ResourceTexture : IUnknown 189 { 190 extern(Windows): 191 HRESULT Update(const uint *minimumExtents, const uint *maximimumExtents, const uint *strides, uint dimensions, const ubyte *data, uint dataCount); 192 } 193 194 mixin(uuid!(ID2D1RenderInfo, "519ae1bd-d19a-420d-b849-364f594776b7")); 195 public interface ID2D1RenderInfo : IUnknown 196 { 197 extern(Windows): 198 HRESULT SetInputDescription(uint inputIndex, D2D1_INPUT_DESCRIPTION inputDescription); 199 HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth); 200 void SetCached(bool isCached); 201 void SetInstructionCountHint(uint instructionCount); 202 } 203 204 mixin(uuid!(ID2D1DrawInfo, "693ce632-7f2f-45de-93fe-18d88b37aa21")); 205 public interface ID2D1DrawInfo : IUnknown 206 { 207 extern(Windows): 208 HRESULT SetPixelShaderConstantBuffer(const ubyte *buffer, uint bufferCount); 209 HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture); 210 HRESULT SetVertexShaderConstantBuffer(const ubyte *buffer, uint bufferCount); 211 HRESULT SetPixelShader(REFGUID shaderId, D2D1_PIXEL_OPTIONS pixelOptions = D2D1_PIXEL_OPTIONS.D2D1_PIXEL_OPTIONS_NONE); 212 HRESULT SetVertexProcessing(ID2D1VertexBuffer vertexBuffer, D2D1_VERTEX_OPTIONS vertexOptions, const D2D1_BLEND_DESCRIPTION *blendDescription = NULL, const D2D1_VERTEX_RANGE *vertexRange = NULL, const GUID *vertexShader = null); 213 } 214 215 mixin(uuid!(ID2D1ComputeInfo, "5598b14b-9fd7-48b7-9bdb-8f0964eb38bc")); 216 public interface ID2D1ComputeInfo : ID2D1RenderInfo 217 { 218 extern(Windows): 219 HRESULT SetComputeShaderConstantBuffer(const ubyte *buffer, uint bufferCount); 220 HRESULT SetComputeShader(REFGUID shaderId); 221 HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture); 222 } 223 224 mixin(uuid!(ID2D1TransformNode, "b2efe1e7-729f-4102-949f-505fa21bf666")); 225 public interface ID2D1TransformNode : IUnknown 226 { 227 extern(Windows): 228 uint GetInputCount(); 229 } 230 231 mixin(uuid!(ID2D1TransformGraph, "13d29038-c3e6-4034-9081-13b53a417992")); 232 public interface ID2D1TransformGraph : IUnknown 233 { 234 extern(Windows): 235 uint GetInputCount(); 236 HRESULT SetSingleTransformNode(ID2D1TransformNode node); 237 HRESULT AddNode(ID2D1TransformNode node); 238 HRESULT RemoveNode(ID2D1TransformNode node); 239 HRESULT SetOutputNode(ID2D1TransformNode node); 240 HRESULT ConnectNode(ID2D1TransformNode fromNode, ID2D1TransformNode toNode, uint toNodeInputIndex); 241 HRESULT ConnectToEffectInput(uint toEffectInputIndex, ID2D1TransformNode node, uint toNodeInputIndex); 242 void Clear(); 243 HRESULT SetPassthroughGraph(uint effectInputIndex); 244 } 245 246 mixin(uuid!(ID2D1Transform, "ef1a287d-342a-4f76-8fdb-da0d6ea9f92b")); 247 public interface ID2D1Transform : ID2D1TransformNode 248 { 249 extern(Windows): 250 const HRESULT MapOutputRectToInputRects(const D2D1_RECT_L *outputRect, D2D1_RECT_L *inputRects, uint inputRectsCount); 251 HRESULT MapInputRectsToOutputRect(const D2D1_RECT_L *inputRects, const D2D1_RECT_L *inputOpaqueSubRects, uint inputRectCount, D2D1_RECT_L *outputRect, D2D1_RECT_L *outputOpaqueSubRect); 252 const HRESULT MapInvalidRect(uint inputIndex, D2D1_RECT_L invalidInputRect, D2D1_RECT_L *invalidOutputRect); 253 } 254 255 mixin(uuid!(ID2D1DrawTransform, "36bfdcb6-9739-435d-a30d-a653beff6a6f")); 256 public interface ID2D1DrawTransform : ID2D1Transform 257 { 258 extern(Windows): 259 HRESULT SetDrawInfo(ID2D1DrawInfo drawInfo); 260 } 261 262 mixin(uuid!(ID2D1ComputeTransform, "0d85573c-01e3-4f7d-bfd9-0d60608bf3c3")); 263 public interface ID2D1ComputeTransform : ID2D1Transform 264 { 265 extern(Windows): 266 HRESULT SetComputeInfo(ID2D1ComputeInfo computeInfo); 267 HRESULT CalculateThreadgroups(const D2D1_RECT_L *outputRect, uint *dimensionX, uint *dimensionY, uint *dimensionZ); 268 } 269 270 mixin(uuid!(ID2D1AnalysisTransform, "0359dc30-95e6-4568-9055-27720d130e93")); 271 public interface ID2D1AnalysisTransform : IUnknown 272 { 273 extern(Windows): 274 HRESULT ProcessAnalysisResults(const ubyte *analysisData, uint analysisDataCount); 275 } 276 277 mixin(uuid!(ID2D1SourceTransform, "db1800dd-0c34-4cf9-be90-31cc0a5653e1")); 278 public interface ID2D1SourceTransform : ID2D1Transform 279 { 280 extern(Windows): 281 HRESULT SetRenderInfo(ID2D1RenderInfo renderInfo); 282 HRESULT Draw(ID2D1Bitmap1 target, const D2D1_RECT_L *drawRect, D2D1_POINT_2U targetOrigin); 283 } 284 285 mixin(uuid!(ID2D1ConcreteTransform, "1a799d8a-69f7-4e4c-9fed-437ccc6684cc")); 286 public interface ID2D1ConcreteTransform : ID2D1TransformNode 287 { 288 extern(Windows): 289 HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth); 290 void SetCached(bool isCached); 291 } 292 293 mixin(uuid!(ID2D1BlendTransform, "63ac0b32-ba44-450f-8806-7f4ca1ff2f1b")); 294 public interface ID2D1BlendTransform : ID2D1ConcreteTransform 295 { 296 extern(Windows): 297 void SetDescription(const D2D1_BLEND_DESCRIPTION *description); 298 const void GetDescription(D2D1_BLEND_DESCRIPTION *description); 299 } 300 301 mixin(uuid!(ID2D1BorderTransform, "4998735c-3a19-473c-9781-656847e3a347")); 302 public interface ID2D1BorderTransform : ID2D1ConcreteTransform 303 { 304 extern(Windows): 305 void SetExtendModeX(D2D1_EXTEND_MODE extendMode); 306 void SetExtendModeY(D2D1_EXTEND_MODE extendMode); 307 const D2D1_EXTEND_MODE GetExtendModeX(); 308 const D2D1_EXTEND_MODE GetExtendModeY(); 309 } 310 311 mixin(uuid!(ID2D1OffsetTransform, "3fe6adea-7643-4f53-bd14-a0ce63f24042")); 312 public interface ID2D1OffsetTransform : ID2D1TransformNode 313 { 314 extern(Windows): 315 void SetOffset(D2D1_POINT_2L offset); 316 const D2D1_POINT_2L GetOffset(); 317 } 318 319 mixin(uuid!(ID2D1BoundsAdjustmentTransform, "90f732e2-5092-4606-a819-8651970baccd")); 320 public interface ID2D1BoundsAdjustmentTransform : ID2D1TransformNode 321 { 322 extern(Windows): 323 void SetOutputBounds(const D2D1_RECT_L *outputBounds); 324 const void GetOutputBounds(D2D1_RECT_L *outputBounds); 325 } 326 327 mixin(uuid!(ID2D1EffectImpl, "a248fd3f-3e6c-4e63-9f03-7f68ecc91db9")); 328 public interface ID2D1EffectImpl : IUnknown 329 { 330 extern(Windows): 331 HRESULT Initialize(ID2D1EffectContext effectContext, ID2D1TransformGraph transformGraph); 332 HRESULT PrepareForRender(D2D1_CHANGE_TYPE changeType); 333 HRESULT SetGraph(ID2D1TransformGraph transformGraph); 334 } 335 336 mixin(uuid!(ID2D1EffectContext, "3d9f916b-27dc-4ad7-b4f1-64945340f563")); 337 public interface ID2D1EffectContext : IUnknown 338 { 339 extern(Windows): 340 const void GetDpi(float *dpiX, float *dpiY); 341 HRESULT CreateEffect(REFCLSID effectId, ID2D1Effect *effect); 342 const HRESULT GetMaximumSupportedFeatureLevel(const D3D_FEATURE_LEVEL *featureLevels, uint featureLevelsCount, D3D_FEATURE_LEVEL *maximumSupportedFeatureLevel); 343 HRESULT CreateTransformNodeFromEffect(ID2D1Effect effect, ID2D1TransformNode *transformNode); 344 HRESULT CreateBlendTransform(uint numInputs, const D2D1_BLEND_DESCRIPTION *blendDescription, ID2D1BlendTransform *transform); 345 HRESULT CreateBorderTransform(D2D1_EXTEND_MODE extendModeX, D2D1_EXTEND_MODE extendModeY, ID2D1BorderTransform *transform); 346 HRESULT CreateOffsetTransform(D2D1_POINT_2L offset, ID2D1OffsetTransform *transform); 347 HRESULT CreateBoundsAdjustmentTransform(const D2D1_RECT_L *outputRectangle, ID2D1BoundsAdjustmentTransform *transform); 348 HRESULT LoadPixelShader(REFGUID shaderId, const ubyte *shaderBuffer, uint shaderBufferCount); 349 HRESULT LoadVertexShader(REFGUID resourceId, const ubyte *shaderBuffer, uint shaderBufferCount); 350 HRESULT LoadComputeShader(REFGUID resourceId, const byte *shaderBuffer, uint shaderBufferCount); 351 bool IsShaderLoaded(REFGUID shaderId); 352 HRESULT CreateResourceTexture(const GUID *resourceId, const D2D1_RESOURCE_TEXTURE_PROPERTIES *resourceTextureProperties, const ubyte *data, const uint *strides, uint dataSize, ID2D1ResourceTexture *resourceTexture); 353 HRESULT FindResourceTexture(const GUID *resourceId, ID2D1ResourceTexture *resourceTexture); 354 HRESULT CreateVertexBuffer(const D2D1_VERTEX_BUFFER_PROPERTIES *vertexBufferProperties, const GUID *resourceId, const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *customVertexBufferProperties, ID2D1VertexBuffer *buffer); 355 HRESULT FindVertexBuffer(const GUID *resourceId, ID2D1VertexBuffer *buffer); 356 HRESULT CreateColorContext(D2D1_COLOR_SPACE space, const ubyte *profile, uint profileSize, ID2D1ColorContext *colorContext); 357 HRESULT CreateColorContextFromFilename(const wchar *filename, ID2D1ColorContext *colorContext); 358 HRESULT CreateColorContextFromWicColorContext(IWICColorContext wicColorContext, ID2D1ColorContext *colorContext); 359 const HRESULT CheckFeatureSupport(D2D1_FEATURE feature, void *featureSupportData, uint featureSupportDataSize); 360 const bool IsBufferPrecisionSupported(D2D1_BUFFER_PRECISION bufferPrecision); 361 }