Wellspring API update
parent
38a0d66e78
commit
8852da6765
|
@ -45,7 +45,6 @@ namespace WellspringCS
|
|||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct FontRange
|
||||
{
|
||||
float FontSize;
|
||||
uint FirstCodepoint;
|
||||
uint NumChars;
|
||||
byte OversampleH;
|
||||
|
@ -75,10 +74,40 @@ namespace WellspringCS
|
|||
byte A;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rectangle
|
||||
{
|
||||
float X;
|
||||
float Y;
|
||||
float W;
|
||||
float H;
|
||||
}
|
||||
|
||||
public enum HorizontalAlignment
|
||||
{
|
||||
Left,
|
||||
Center,
|
||||
Right
|
||||
}
|
||||
|
||||
public enum VerticalAlignment
|
||||
{
|
||||
Baseline,
|
||||
Top,
|
||||
Middle,
|
||||
Bottom
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Wellspring_CreateFont(
|
||||
IntPtr fontBytes,
|
||||
uint fontBytesLength
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Wellspring_CreatePacker(
|
||||
IntPtr fontBytes,
|
||||
uint fontBytesLength,
|
||||
IntPtr Font,
|
||||
float fontSize,
|
||||
uint width,
|
||||
uint height,
|
||||
uint strideInBytes,
|
||||
|
@ -106,6 +135,18 @@ namespace WellspringCS
|
|||
IntPtr packer
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern byte Wellspring_TextBounds(
|
||||
IntPtr textBatch,
|
||||
float x,
|
||||
float y,
|
||||
HorizontalAlignment horizontalAlignment,
|
||||
VerticalAlignment verticalAlignment,
|
||||
IntPtr strBytes, /* UTF-8 bytes */
|
||||
uint strLengthInBytes,
|
||||
out Rectangle rectangle
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern byte Wellspring_Draw(
|
||||
IntPtr textBatch,
|
||||
|
@ -113,6 +154,8 @@ namespace WellspringCS
|
|||
float y,
|
||||
float depth,
|
||||
in Color color,
|
||||
HorizontalAlignment horizontalAlignment,
|
||||
VerticalAlignment verticalAlignment,
|
||||
IntPtr strBytes, /* UTF-8 bytes */
|
||||
uint strLengthInBytes
|
||||
);
|
||||
|
@ -135,5 +178,10 @@ namespace WellspringCS
|
|||
public static extern void Wellspring_DestroyPacker(
|
||||
IntPtr packer
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Wellspring_DestroyFont(
|
||||
IntPtr font
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue