Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up and finalizing the d2d1*helper bindings #23

Merged
merged 6 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sources/Interop/D2D1/um/d2d1/D2D1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ public static unsafe partial class D2D1
[return: NativeTypeName("HRESULT")]
public static extern int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("const D2D1_FACTORY_OPTIONS *")] D2D1_FACTORY_OPTIONS* pFactoryOptions, [NativeTypeName("void **")] void** ppIFactory);

[DllImport(LibraryPath, CallingConvention = CallingConvention.StdCall, EntryPoint = "D2D1MakeRotateMatrix", ExactSpelling = true)]
public static extern void D2D1MakeRotateMatrix([NativeTypeName("FLOAT")] float angle, [NativeTypeName("D2D1_POINT_2F")] D2D_POINT_2F center, [NativeTypeName("D2D1_MATRIX_3X2_F *")] D2D_MATRIX_3X2_F* matrix);

[DllImport(LibraryPath, CallingConvention = CallingConvention.StdCall, EntryPoint = "D2D1MakeSkewMatrix", ExactSpelling = true)]
public static extern void D2D1MakeSkewMatrix([NativeTypeName("FLOAT")] float angleX, [NativeTypeName("FLOAT")] float angleY, [NativeTypeName("D2D1_POINT_2F")] D2D_POINT_2F center, [NativeTypeName("D2D1_MATRIX_3X2_F *")] D2D_MATRIX_3X2_F* matrix);

[DllImport(LibraryPath, CallingConvention = CallingConvention.StdCall, EntryPoint = "D2D1IsMatrixInvertible", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int D2D1IsMatrixInvertible([NativeTypeName("const D2D1_MATRIX_3X2_F *")] D2D_MATRIX_3X2_F* matrix);

[DllImport(LibraryPath, CallingConvention = CallingConvention.StdCall, EntryPoint = "D2D1InvertMatrix", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int D2D1InvertMatrix([NativeTypeName("D2D1_MATRIX_3X2_F *")] D2D_MATRIX_3X2_F* matrix);

[return: NativeTypeName("HRESULT")]
public static int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** factory)
{
Expand Down
10 changes: 4 additions & 6 deletions sources/Interop/D2D1/um/d2d1/D2D1_ARC_SEGMENT.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_ARC_SEGMENT
{
public D2D1_ARC_SEGMENT(in D2D_POINT_2F point, in D2D_SIZE_F size, float rotationAngle, D2D1_SWEEP_DIRECTION sweepDirection, D2D1_ARC_SIZE arcSize)
public D2D1_ARC_SEGMENT([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point, [NativeTypeName("const D2D1_SIZE_F &")] in D2D_SIZE_F size, [NativeTypeName("FLOAT")] float rotationAngle, D2D1_SWEEP_DIRECTION sweepDirection, D2D1_ARC_SIZE arcSize)
{
this.point = point;
this.size = size;
this.rotationAngle = rotationAngle;
this.sweepDirection = sweepDirection;
this.arcSize = arcSize;
this = ArcSegment(point, size, rotationAngle, sweepDirection, arcSize);
}
}
}
8 changes: 4 additions & 4 deletions sources/Interop/D2D1/um/d2d1/D2D1_BEZIER_SEGMENT.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_BEZIER_SEGMENT
{
public D2D1_BEZIER_SEGMENT(in D2D_POINT_2F point1, in D2D_POINT_2F point2, in D2D_POINT_2F point3)
public D2D1_BEZIER_SEGMENT([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point1, [NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point2, [NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point3)
{
this.point1 = point1;
this.point2 = point2;
this.point3 = point3;
this = BezierSegment(point1, point2, point3);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;
using static TerraFX.Interop.D2D1_BITMAP_INTERPOLATION_MODE;
using static TerraFX.Interop.D2D1_EXTEND_MODE;

namespace TerraFX.Interop
{
public partial struct D2D1_BITMAP_BRUSH_PROPERTIES
{
public static readonly D2D1_BITMAP_BRUSH_PROPERTIES DEFAULT = new D2D1_BITMAP_BRUSH_PROPERTIES(D2D1_EXTEND_MODE.D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE.D2D1_EXTEND_MODE_CLAMP, D2D1_BITMAP_INTERPOLATION_MODE.D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
public static readonly D2D1_BITMAP_BRUSH_PROPERTIES DEFAULT = new D2D1_BITMAP_BRUSH_PROPERTIES(D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE_CLAMP, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);

public D2D1_BITMAP_BRUSH_PROPERTIES(D2D1_EXTEND_MODE extendModeX, D2D1_EXTEND_MODE extendModeY, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode)
public D2D1_BITMAP_BRUSH_PROPERTIES(D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR)
{
this.extendModeX = extendModeX;
this.extendModeY = extendModeY;
this.interpolationMode = interpolationMode;
this = BitmapBrushProperties(extendModeX, extendModeY, interpolationMode);
}
}
}
10 changes: 5 additions & 5 deletions sources/Interop/D2D1/um/d2d1/D2D1_BITMAP_PROPERTIES.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_BITMAP_PROPERTIES
{
public static readonly D2D1_BITMAP_PROPERTIES DEFAULT = new D2D1_BITMAP_PROPERTIES(D2D1_PIXEL_FORMAT.DEFAULT, 96.0f, 96.0f);
public static readonly D2D1_BITMAP_PROPERTIES DEFAULT = new D2D1_BITMAP_PROPERTIES(default, 96.0f, 96.0f);

public D2D1_BITMAP_PROPERTIES(D2D1_PIXEL_FORMAT pixelFormat, float dpiX, float dpiY)
public D2D1_BITMAP_PROPERTIES([NativeTypeName("const D2D1_PIXEL_FORMAT &")] in D2D1_PIXEL_FORMAT pixelFormat = default, [NativeTypeName("FLOAT")] float dpiX = 96.0f, [NativeTypeName("FLOAT")] float dpiY = 96.0f)
{
this.pixelFormat = pixelFormat;
this.dpiX = dpiX;
this.dpiY = dpiY;
this = BitmapProperties(pixelFormat, dpiX, dpiY);
}
}
}
10 changes: 7 additions & 3 deletions sources/Interop/D2D1/um/d2d1/D2D1_BRUSH_PROPERTIES.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
// Original source is Copyright © Microsoft. All rights reserved.

using System.Runtime.InteropServices;
using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_BRUSH_PROPERTIES
{
public static readonly D2D1_BRUSH_PROPERTIES DEFAULT = new D2D1_BRUSH_PROPERTIES(1.0f, D2D_MATRIX_3X2_F.Identity);

public D2D1_BRUSH_PROPERTIES(float opacity, in D2D_MATRIX_3X2_F transform)
public D2D1_BRUSH_PROPERTIES([NativeTypeName("FLOAT")] float opacity = 1.0f) : this(opacity, IdentityMatrix)
{
this.opacity = opacity;
this.transform = transform;
}

public D2D1_BRUSH_PROPERTIES([NativeTypeName("FLOAT"), Optional, DefaultParameterValue(1.0f)] float opacity, [NativeTypeName("const D2D1_MATRIX_3X2_F &")] in D2D_MATRIX_3X2_F transform)
{
this = BrushProperties(opacity, transform);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using System.Runtime.InteropServices;
using static TerraFX.Interop.D2D1;
using static TerraFX.Interop.D2D1_ANTIALIAS_MODE;
using static TerraFX.Interop.D2D1_TEXT_ANTIALIAS_MODE;

namespace TerraFX.Interop
{
public partial struct D2D1_DRAWING_STATE_DESCRIPTION
{
public static readonly D2D1_DRAWING_STATE_DESCRIPTION DEFAULT = new D2D1_DRAWING_STATE_DESCRIPTION(D2D1_ANTIALIAS_MODE.D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1_TEXT_ANTIALIAS_MODE.D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, 0ul, 0ul, D2D_MATRIX_3X2_F.Identity);
public static readonly D2D1_DRAWING_STATE_DESCRIPTION DEFAULT = new D2D1_DRAWING_STATE_DESCRIPTION(D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, 0, 0, IdentityMatrix);

public D2D1_DRAWING_STATE_DESCRIPTION(D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, [NativeTypeName("D2D1_TAG")] ulong tag1 = 0, [NativeTypeName("D2D1_TAG")] ulong tag2 = 0)
: this(antialiasMode, textAntialiasMode, tag1, tag2, IdentityMatrix)
{
}

public D2D1_DRAWING_STATE_DESCRIPTION(D2D1_ANTIALIAS_MODE antialiasMode, D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode, ulong tag1, ulong tag2, D2D_MATRIX_3X2_F transform)
public D2D1_DRAWING_STATE_DESCRIPTION([Optional] D2D1_ANTIALIAS_MODE antialiasMode, [Optional] D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode, [NativeTypeName("D2D1_TAG"), Optional] ulong tag1, [NativeTypeName("D2D1_TAG"), Optional] ulong tag2, [NativeTypeName("const D2D1_MATRIX_3X2_F &")] D2D_MATRIX_3X2_F transform)
{
this.antialiasMode = antialiasMode;
this.textAntialiasMode = textAntialiasMode;
this.tag1 = tag1;
this.tag2 = tag2;
this.transform = transform;
this = DrawingStateDescription(antialiasMode, textAntialiasMode, tag1, tag2, transform);
}
}
}
8 changes: 4 additions & 4 deletions sources/Interop/D2D1/um/d2d1/D2D1_ELLIPSE.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_ELLIPSE
{
public D2D1_ELLIPSE(in D2D_POINT_2F center, float radiusX, float radiusY)
public D2D1_ELLIPSE([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F center, [NativeTypeName("FLOAT")] float radiusX, [NativeTypeName("FLOAT")] float radiusY)
{
point = center;
this.radiusX = radiusX;
this.radiusY = radiusY;
this = Ellipse(center, radiusX, radiusY);
}
}
}
7 changes: 4 additions & 3 deletions sources/Interop/D2D1/um/d2d1/D2D1_GRADIENT_STOP.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_GRADIENT_STOP
{
public D2D1_GRADIENT_STOP(float position, in DXGI_RGBA color)
public D2D1_GRADIENT_STOP([NativeTypeName("FLOAT")] float position, [NativeTypeName("const D2D1_COLOR_F &")] in DXGI_RGBA color)
{
this.position = position;
this.color = color;
this = GradientStop(position, color);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
// Original source is Copyright © Microsoft. All rights reserved.

using System;
using static TerraFX.Interop.D2D1;
using static TerraFX.Interop.D2D1_PRESENT_OPTIONS;

namespace TerraFX.Interop
{
public partial struct D2D1_HWND_RENDER_TARGET_PROPERTIES
{
public D2D1_HWND_RENDER_TARGET_PROPERTIES(IntPtr hwnd, D2D_SIZE_U pixelSize, D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS.D2D1_PRESENT_OPTIONS_NONE)
{
this.hwnd = hwnd;
this.pixelSize = pixelSize;
this.presentOptions = presentOptions;
}

public D2D1_HWND_RENDER_TARGET_PROPERTIES(IntPtr hwnd, D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS.D2D1_PRESENT_OPTIONS_NONE) : this(hwnd, new D2D_SIZE_U(0, 0), presentOptions)
public D2D1_HWND_RENDER_TARGET_PROPERTIES([NativeTypeName("HWND")] IntPtr hwnd, [NativeTypeName("D2D1_SIZE_U")] D2D_SIZE_U pixelSize = default, D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE)
{
this = HwndRenderTargetProperties(hwnd, pixelSize, presentOptions);
}
}
}
32 changes: 23 additions & 9 deletions sources/Interop/D2D1/um/d2d1/D2D1_LAYER_PARAMETERS.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using System.Runtime.InteropServices;
using static TerraFX.Interop.D2D1;
using static TerraFX.Interop.D2D1_ANTIALIAS_MODE;
using static TerraFX.Interop.D2D1_LAYER_OPTIONS;

namespace TerraFX.Interop
{
public unsafe partial struct D2D1_LAYER_PARAMETERS
{
public static readonly D2D1_LAYER_PARAMETERS DEFAULT = new D2D1_LAYER_PARAMETERS(D2D_RECT_F.Infinite, null, D2D1_ANTIALIAS_MODE.D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D_MATRIX_3X2_F.Identity, 1.0f, null, D2D1_LAYER_OPTIONS.D2D1_LAYER_OPTIONS_NONE);
public static readonly D2D1_LAYER_PARAMETERS DEFAULT = new D2D1_LAYER_PARAMETERS(InfiniteRect, null, D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, IdentityMatrix, 1.0f, null, D2D1_LAYER_OPTIONS_NONE);

public D2D1_LAYER_PARAMETERS([NativeTypeName("ID2D1Geometry *"), Optional] ID2D1Geometry* geometricMask, [Optional] D2D1_ANTIALIAS_MODE maskAntialiasMode, [NativeTypeName("FLOAT")] float opacity = 1.0f, [NativeTypeName("ID2D1Brush *")] ID2D1Brush* opacityBrush = null, D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE)
: this(InfiniteRect, geometricMask, maskAntialiasMode, IdentityMatrix, opacity, opacityBrush, layerOptions)
{
}

public D2D1_LAYER_PARAMETERS([NativeTypeName("const D2D1_RECT_F")] in D2D_RECT_F contentBounds, [NativeTypeName("ID2D1Geometry *"), Optional] ID2D1Geometry* geometricMask, [Optional] D2D1_ANTIALIAS_MODE maskAntialiasMode, [NativeTypeName("FLOAT")] float opacity = 1.0f, [NativeTypeName("ID2D1Brush *")] ID2D1Brush* opacityBrush = null, D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE)
: this(contentBounds, geometricMask, maskAntialiasMode, IdentityMatrix, opacity, opacityBrush, layerOptions)
{
}

public D2D1_LAYER_PARAMETERS([NativeTypeName("ID2D1Geometry *"), Optional] ID2D1Geometry* geometricMask, [Optional] D2D1_ANTIALIAS_MODE maskAntialiasMode, [NativeTypeName("D2D1_MATRIX_3X2_F")] D2D_MATRIX_3X2_F maskTransform, [NativeTypeName("FLOAT")] float opacity = 1.0f, [NativeTypeName("ID2D1Brush *")] ID2D1Brush* opacityBrush = null, D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE)
: this(InfiniteRect, geometricMask, maskAntialiasMode, maskTransform, opacity, opacityBrush, layerOptions)
{
}

public D2D1_LAYER_PARAMETERS(D2D_RECT_F contentBounds, ID2D1Geometry* geometricMask, D2D1_ANTIALIAS_MODE maskAntialiasMode, D2D_MATRIX_3X2_F maskTransform, float opacity, ID2D1Brush* opacityBrush, D2D1_LAYER_OPTIONS layerOptions)
public D2D1_LAYER_PARAMETERS([NativeTypeName("const D2D1_RECT_F")] in D2D_RECT_F contentBounds, [NativeTypeName("ID2D1Geometry *"), Optional] ID2D1Geometry* geometricMask, [Optional] D2D1_ANTIALIAS_MODE maskAntialiasMode, [NativeTypeName("D2D1_MATRIX_3X2_F")] D2D_MATRIX_3X2_F maskTransform, [NativeTypeName("FLOAT")] float opacity = 1.0f, [NativeTypeName("ID2D1Brush *")] ID2D1Brush* opacityBrush = null, D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE)
{
this.contentBounds = contentBounds;
this.geometricMask = geometricMask;
this.maskAntialiasMode = maskAntialiasMode;
this.maskTransform = maskTransform;
this.opacity = opacity;
this.opacityBrush = opacityBrush;
this.layerOptions = layerOptions;
this = LayerParameters(contentBounds, geometricMask, maskAntialiasMode, maskTransform, opacity, opacityBrush, layerOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
{
public D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES(in D2D_POINT_2F startPoint, in D2D_POINT_2F endPoint)
public D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F startPoint, [NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F endPoint)
{
this.startPoint = startPoint;
this.endPoint = endPoint;
this = LinearGradientBrushProperties(startPoint, endPoint);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_QUADRATIC_BEZIER_SEGMENT
{
public D2D1_QUADRATIC_BEZIER_SEGMENT(in D2D_POINT_2F point1, in D2D_POINT_2F point2)
public D2D1_QUADRATIC_BEZIER_SEGMENT([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point1, [NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F point2)
{
this.point1 = point1;
this.point2 = point2;
this = QuadraticBezierSegment(point1, point2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;

namespace TerraFX.Interop
{
public partial struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
{
public D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES(in D2D_POINT_2F center, in D2D_POINT_2F gradientOriginOffset, float radiusX, float radiusY)
public D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES([NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F center, [NativeTypeName("const D2D1_POINT_2F &")] in D2D_POINT_2F gradientOriginOffset, [NativeTypeName("FLOAT")] float radiusX, [NativeTypeName("FLOAT")] float radiusY)
{
this.center = center;
this.gradientOriginOffset = gradientOriginOffset;
this.radiusX = radiusX;
this.radiusY = radiusY;
this = RadialGradientBrushProperties(center, gradientOriginOffset, radiusX, radiusY);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
// Ported from um/d2d1helper.h in the Windows SDK for Windows 10.0.18362.0
// Original source is Copyright © Microsoft. All rights reserved.

using static TerraFX.Interop.D2D1;
using static TerraFX.Interop.D2D1_FEATURE_LEVEL;
using static TerraFX.Interop.D2D1_RENDER_TARGET_TYPE;
using static TerraFX.Interop.D2D1_RENDER_TARGET_USAGE;

namespace TerraFX.Interop
{
public partial struct D2D1_RENDER_TARGET_PROPERTIES
{
public static readonly D2D1_RENDER_TARGET_PROPERTIES DEFAULT = new D2D1_RENDER_TARGET_PROPERTIES(D2D1_RENDER_TARGET_TYPE.D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1_PIXEL_FORMAT.DEFAULT, 0.0f, 0.0f, D2D1_RENDER_TARGET_USAGE.D2D1_RENDER_TARGET_USAGE_NONE, D2D1_FEATURE_LEVEL.D2D1_FEATURE_LEVEL_DEFAULT);
public static readonly D2D1_RENDER_TARGET_PROPERTIES DEFAULT = new D2D1_RENDER_TARGET_PROPERTIES(D2D1_RENDER_TARGET_TYPE_DEFAULT, default, 0.0f, 0.0f, D2D1_RENDER_TARGET_USAGE_NONE, D2D1_FEATURE_LEVEL_DEFAULT);

public D2D1_RENDER_TARGET_PROPERTIES(D2D1_RENDER_TARGET_TYPE type, D2D1_PIXEL_FORMAT pixelFormat, float dpiX, float dpiY, D2D1_RENDER_TARGET_USAGE usage, D2D1_FEATURE_LEVEL minLevel)
public D2D1_RENDER_TARGET_PROPERTIES(D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT, [NativeTypeName("const D2D1_PIXEL_FORMAT &")] in D2D1_PIXEL_FORMAT pixelFormat = default, [NativeTypeName("FLOAT")] float dpiX = 0.0f, [NativeTypeName("FLOAT")] float dpiY = 0.0f, D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE, D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT)
{
this.type = type;
this.pixelFormat = pixelFormat;
this.dpiX = dpiX;
this.dpiY = dpiY;
this.usage = usage;
this.minLevel = minLevel;
this = RenderTargetProperties(type, pixelFormat, dpiX, dpiY, usage, minLevel);
}
}
}
Loading