mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2025-01-10 19:05:30 +00:00
SDL2_ttf done. Unless someone cares about RWops.
This commit is contained in:
parent
7e4fffb05b
commit
5f1385b2ea
416
src/SDL2_ttf.cs
416
src/SDL2_ttf.cs
|
@ -47,16 +47,16 @@ namespace SDL2
|
|||
public const int UNICODE_BOM_NATIVE = 0xFEFF;
|
||||
public const int UNICODE_BOM_SWAPPED = 0xFFFE;
|
||||
|
||||
public const int TTF_STYLE_NORMAL = 0x00;
|
||||
public const int TTF_STYLE_BOLD = 0x01;
|
||||
public const int TTF_STYLE_ITALIC = 0x02;
|
||||
public const int TTF_STYLE_NORMAL = 0x00;
|
||||
public const int TTF_STYLE_BOLD = 0x01;
|
||||
public const int TTF_STYLE_ITALIC = 0x02;
|
||||
public const int TTF_STYLE_UNDERLINE = 0x04;
|
||||
public const int TTF_STYLE_STRIKETHROUGH = 0x08;
|
||||
|
||||
public const int TTF_HINTING_NORMAL = 0;
|
||||
public const int TTF_HINTING_LIGHT = 1;
|
||||
public const int TTF_HINTING_MONO = 2;
|
||||
public const int TTF_HINTING_NONE = 3;
|
||||
public const int TTF_HINTING_MONO = 2;
|
||||
public const int TTF_HINTING_NONE = 3;
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_LinkedVersion")]
|
||||
private static extern IntPtr INTERNAL_TTF_LinkedVersion();
|
||||
|
@ -219,9 +219,409 @@ namespace SDL2
|
|||
ref int h
|
||||
);
|
||||
|
||||
/* TODO: A crapload of SDL_Surface generators.
|
||||
* http://hg.libsdl.org/SDL_ttf/file/default/SDL_ttf.h
|
||||
*/
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderText_Solid")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderText_Solid(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderText_Solid(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderText_Solid(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Solid")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Solid(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUTF8_Solid(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUTF8_Solid(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUNICODE_Solid")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUNICODE_Solid(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUNICODE_Solid(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUNICODE_Solid(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderGlyph_Solid")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderGlyph_Solid(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderGlyph_Solid(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderGlyph_Solid(
|
||||
font,
|
||||
ch,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderText_Shaded")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderText_Shaded(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderText_Shaded(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderText_Shaded(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
bg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Shaded")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Shaded(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUTF8_Shaded(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUTF8_Shaded(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
bg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUNICODE_Shaded")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUNICODE_Shaded(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUNICODE_Shaded(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUNICODE_Shaded(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
bg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderGlyph_Shaded")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderGlyph_Shaded(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderGlyph_Shaded(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg,
|
||||
SDL2.SDL_Color bg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderGlyph_Shaded(
|
||||
font,
|
||||
ch,
|
||||
fg,
|
||||
bg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderText_Blended")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderText_Blended(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderText_Blended(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderText_Blended(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Blended(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUTF8_Blended(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUTF8_Blended(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUNICODE_Blended")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUNICODE_Blended(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUNICODE_Blended(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUNICODE_Blended(
|
||||
font,
|
||||
text,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderText_Blended_Wrapped")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderText_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderText_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderText_Blended_Wrapped(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
wrapped
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUTF8_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUTF8_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
string text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUTF8_Blended_Wrapped(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
wrapped
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderUNICODE_Blended_Wrapped")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderUNICODE_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderUNICODE_Blended_Wrapped(
|
||||
IntPtr font,
|
||||
ushort[] text,
|
||||
SDL2.SDL_Color fg,
|
||||
uint wrapped
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderUNICODE_Blended_Wrapped(
|
||||
font,
|
||||
text,
|
||||
fg,
|
||||
wrapped
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName, EntryPoint = "TTF_RenderGlyph_Blended")]
|
||||
private static extern IntPtr INTERNAL_TTF_RenderGlyph_Blended(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg
|
||||
);
|
||||
public static SDL2.SDL_Surface TTF_RenderGlyph_Blended(
|
||||
IntPtr font,
|
||||
ushort ch,
|
||||
SDL2.SDL_Color fg
|
||||
) {
|
||||
SDL2.SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_TTF_RenderGlyph_Blended(
|
||||
font,
|
||||
ch,
|
||||
fg
|
||||
);
|
||||
result = (SDL2.SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* font refers to a TTF_Font* */
|
||||
[DllImport(nativeLibName)]
|
||||
|
|
Loading…
Reference in a new issue