1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-27 20:18:01 +02:00

Inital update

This commit is contained in:
Martin Cietwierkowski 2023-03-31 19:52:41 -04:00
parent 7083739120
commit 6dc1ad22f9
93 changed files with 23961 additions and 8506 deletions

File diff suppressed because it is too large Load diff

View file

@ -35,15 +35,17 @@ namespace SDL2
* program!
*/
public const int SDL_IMAGE_MAJOR_VERSION = 2;
public const int SDL_IMAGE_MINOR_VERSION = 0;
public const int SDL_IMAGE_PATCHLEVEL = 2;
public const int SDL_IMAGE_MINOR_VERSION = 6;
public const int SDL_IMAGE_PATCHLEVEL = 3;
public enum InitFlags : int32
{
JPG = 0x00000001,
PNG = 0x00000002,
TIF = 0x00000004,
WEBP = 0x00000008
WEBP = 0x00000008,
JXL = 0x00000010,
AVIF = 0x00000020
}
public static void SDL_IMAGE_VERSION(out SDL.Version X)
@ -99,6 +101,123 @@ namespace SDL2
char8* type
);
[LinkName("IMG_isAVIF")]
public static extern int32 isAVIF(SDL.RWOps* src);
[LinkName("IMG_isICO")]
public static extern int32 isICO(SDL.RWOps* src);
[LinkName("IMG_isCUR")]
public static extern int32 isCUR(SDL.RWOps* src);
[LinkName("IMG_isBMP")]
public static extern int32 isBMP(SDL.RWOps* src);
[LinkName("IMG_isGIF")]
public static extern int32 isGIF(SDL.RWOps* src);
[LinkName("IMG_isJPG")]
public static extern int32 isJPG(SDL.RWOps* src);
[LinkName("IMG_isJXL")]
public static extern int32 isJXL(SDL.RWOps* src);
[LinkName("IMG_isLBM")]
public static extern int32 isLBM(SDL.RWOps* src);
[LinkName("IMG_isPCX")]
public static extern int32 isPCX(SDL.RWOps* src);
[LinkName("IMG_isPNG")]
public static extern int32 isPNG(SDL.RWOps* src);
[LinkName("IMG_isPNM")]
public static extern int32 isPNM(SDL.RWOps* src);
[LinkName("IMG_isSVG")]
public static extern int32 isSVG(SDL.RWOps* src);
[LinkName("IMG_isQOI")]
public static extern int32 isQOI(SDL.RWOps* src);
[LinkName("IMG_isTIF")]
public static extern int32 isTIF(SDL.RWOps* src);
[LinkName("IMG_isXCF")]
public static extern int32 isXCF(SDL.RWOps* src);
[LinkName("IMG_isXPM")]
public static extern int32 isXPM(SDL.RWOps* src);
[LinkName("IMG_isXV")]
public static extern int32 isXV(SDL.RWOps* src);
[LinkName("IMG_isWEBP")]
public static extern int32 isWEBP(SDL.RWOps* src);
[LinkName("IMG_LoadAVIF_RW")]
public static extern SDL.Surface* LoadAVIF_RW(SDL.RWOps* src);
[LinkName("IMG_LoadICO_RW")]
public static extern SDL.Surface* LoadICO_RW(SDL.RWOps* src);
[LinkName("IMG_LoadCUR_RW")]
public static extern SDL.Surface* LoadCUR_RW(SDL.RWOps* src);
[LinkName("IMG_LoadBMP_RW")]
public static extern SDL.Surface* LoadBMP_RW(SDL.RWOps* src);
[LinkName("IMG_LoadGIF_RW")]
public static extern SDL.Surface* LoadGIF_RW(SDL.RWOps* src);
[LinkName("IMG_LoadJPG_RW")]
public static extern SDL.Surface* LoadJPG_RW(SDL.RWOps* src);
[LinkName("IMG_LoadJXL_RW")]
public static extern SDL.Surface* LoadJXL_RW(SDL.RWOps* src);
[LinkName("IMG_LoadLBM_RW")]
public static extern SDL.Surface* LoadLBM_RW(SDL.RWOps* src);
[LinkName("IMG_LoadPCX_RW")]
public static extern SDL.Surface* LoadPCX_RW(SDL.RWOps* src);
[LinkName("IMG_LoadPNG_RW")]
public static extern SDL.Surface* LoadPNG_RW(SDL.RWOps* src);
[LinkName("IMG_LoadPNM_RW")]
public static extern SDL.Surface* LoadPNM_RW(SDL.RWOps* src);
[LinkName("IMG_LoadSVG_RW")]
public static extern SDL.Surface* LoadSVG_RW(SDL.RWOps* src);
[LinkName("IMG_LoadQOI_RW")]
public static extern SDL.Surface* LoadQOI_RW(SDL.RWOps* src);
[LinkName("IMG_LoadTGA_RW")]
public static extern SDL.Surface* LoadTGA_RW(SDL.RWOps* src);
[LinkName("IMG_LoadTIF_RW")]
public static extern SDL.Surface* LoadTIF_RW(SDL.RWOps* src);
[LinkName("IMG_LoadXCF_RW")]
public static extern SDL.Surface* LoadXCF_RW(SDL.RWOps* src);
[LinkName("IMG_LoadXPM_RW")]
public static extern SDL.Surface* LoadXPM_RW(SDL.RWOps* src);
[LinkName("IMG_LoadXV_RW")]
public static extern SDL.Surface* LoadXV_RW(SDL.RWOps* src);
[LinkName("IMG_LoadWEBP_RW")]
public static extern SDL.Surface* LoadWEBP_RW(SDL.RWOps* src);
[LinkName("IMG_LoadSizedSVG_RW")]
public static extern SDL.Surface* LoadSizedSVG_RW(SDL.RWOps* src, int32 width, int32 height);
[LinkName("IMG_ReadXPMFromArrayToRGB888")]
public static extern SDL.Surface* ReadXPMFromArrayToRGB888(char8** xpm);
[LinkName("IMG_ReadXPMFromArray")]
public static extern SDL.Surface* ReadXPMFromArray(char8** xpm);
@ -122,5 +241,29 @@ namespace SDL2
int32 freedst,
int32 quality
);
[CRepr]
public struct Animation
{
int32 w;
int32 h;
SDL.Surface** frames;
int32* delays;
}
[LinkName("IMG_LoadAnimation")]
public static extern Animation* LoadAnimation(char* file);
[LinkName("IMG_LoadAnimation_RW")]
public static extern Animation* LoadAnimation(SDL.RWOps* src, int32 freesrc);
[LinkName("IMG_LoadAnimationTyped_RW")]
public static extern Animation* LoadAnimationTyped_RW(SDL.RWOps* src, int32 freesrc, char8* type);
[LinkName("IMG_FreeAnimation")]
public static extern void IMG_FreeAnimation(Animation* anim);
[LinkName("IMG_LoadGIFAnimation_RW")]
public static extern Animation* LoadGIFAnimation_RW(SDL_RWops *src);
}
}

View file

@ -39,8 +39,8 @@ namespace SDL2
* program!
*/
public const int32 MIXER_MAJOR_VERSION = 2;
public const int32 MIXER_MINOR_VERSION = 0;
public const int32 MIXER_PATCHLEVEL = 2;
public const int32 MIXER_MINOR_VERSION = 6;
public const int32 MIXER_PATCHLEVEL = 3;
/* In C, you can redefine this value before including SDL_mixer.h.
* We're not going to allow this in SDL2#, since the value of this
@ -48,7 +48,7 @@ namespace SDL2
*/
public const int32 MIX_CHANNELS = 8;
public static readonly int32 MIX_DEFAULT_FREQUENCY = 22050;
public static readonly int32 MIX_DEFAULT_FREQUENCY = 44100;
public static readonly uint16 MIX_DEFAULT_FORMAT =
BitConverter.IsLittleEndian ? SDL.AUDIO_S16LSB : SDL.AUDIO_S16MSB;
public static readonly int32 MIX_DEFAULT_CHANNELS = 2;
@ -61,6 +61,7 @@ namespace SDL2
Mp3 = 0x00000008,
Ogg = 0x00000010,
Mid = 0x00000020,
Opus = 0x00000040,
}
public enum Fading
@ -81,9 +82,10 @@ namespace SDL2
Mp3,
Mp3Mad,
Flac,
Modplug
Modplug,
Opus
}
public function void MixFuncDelegate(void* udata, uint8* stream, int32 len);
public function void Mix_EffectFunc_t(int32 chan, void* stream, int32 len, void* udata);
@ -138,7 +140,7 @@ namespace SDL2
SDL.RWOps* src,
int freesrc
);
public static Chunk* LoadWAV(StringView file)
{
SDL.RWOps* rwops = SDL.RWFromFile(file.ToScopeCStr!(), "rb");
@ -175,6 +177,21 @@ namespace SDL2
[LinkName("Mix_GetMusicType")]
public static extern MusicType GetMusicType(Music* music);
[LinkName("Mix_GetMusicTitle")]
public static extern char8* GetMusicTitle(Music* music);
[LinkName("Mix_GetMusicTitleTag")]
public static extern char8* GetMusicTitleTag(Music* music);
[LinkName("Mix_GetMusicArtistTag")]
public static extern char8* GetMusicArtistTag(Music* music);
[LinkName("Mix_GetMusicAlbumTag")]
public static extern char8* GetMusicAlbumTag(Music* music);
[LinkName("Mix_GetMusicCopyrightTag")]
public static extern char8* GetMusicCopyrightTag(Music* music);
[LinkName("Mix_SetPostMix")]
public static extern void SetPostMix(
MixFuncDelegate mix_func,
@ -276,6 +293,14 @@ namespace SDL2
int ticks
);
/* chunk refers to a Mix_Chunk* */
[LinkName("Mix_PlayChannel")]
public static extern int32 PlayChannel(
int channel,
Chunk* chunk,
int loops
);
[LinkName("Mix_PlayMusic")]
public static extern int32 PlayMusic(Music* music, int32 loops);
@ -313,6 +338,14 @@ namespace SDL2
int ticks
);
[LinkName("Mix_FadeInChannel")]
public static extern int32 FadeInChannel(
int channel,
Chunk* chunk,
int loops,
int ms
);
[LinkName("Mix_Volume")]
public static extern int32 Volume(int32 channel, int32 volume);
@ -326,6 +359,9 @@ namespace SDL2
[LinkName("Mix_VolumeMusic")]
public static extern int32 VolumeMusic(int32 volume);
[LinkName("Mix_MasterVolume")]
public static extern int32 MasterVolume(int32 volume);
[LinkName("Mix_HaltChannel")]
public static extern int32 HaltChannel(int32 channel);
@ -374,9 +410,27 @@ namespace SDL2
[LinkName("Mix_PausedMusic")]
public static extern int32 PausedMusic();
[LinkName("Mix_ModMusicJumpToOrder")]
public static extern int32 ModMusicJumpToOrder(int32 order);
[LinkName("Mix_SetMusicPosition")]
public static extern int32 SetMusicPosition(double position);
[LinkName("Mix_GetMusicPosition")]
public static extern double GetMusicPosition(Music* music);
[LinkName("Mix_MusicDuration")]
public static extern double MusicDuration(Music* music);
[LinkName("Mix_GetMusicLoopStartTime")]
public static extern double GetMusicLoopStartTime(Music* music);
[LinkName("Mix_GetMusicLoopEndTime")]
public static extern double GetMusicLoopEndTime(Music* music);
[LinkName("Mix_GetMusicLoopLengthTime")]
public static extern double GetMusicLoopLengthTime(Music* music);
[LinkName("Mix_Playing")]
public static extern int32 Playing(int32 channel);
@ -406,5 +460,11 @@ namespace SDL2
[LinkName("Mix_CloseAudio")]
public static extern void CloseAudio();
[LinkName("Mix_SetTimidityCfg")]
public static extern int32 SetTimidityCfg(char8* path);
[LinkName("Mix_GetTimidityCfg")]
public static extern char8* Mix_GetTimidityCfg(void);
}
}

View file

@ -35,8 +35,8 @@ namespace SDL2
* program!
*/
public const int32 SDL_TTF_MAJOR_VERSION = 2;
public const int32 SDL_TTF_MINOR_VERSION = 0;
public const int32 SDL_TTF_PATCHLEVEL = 12;
public const int32 SDL_TTF_MINOR_VERSION = 20;
public const int32 SDL_TTF_PATCHLEVEL = 2;
public const int32 UNICODE_BOM_NATIVE = 0xFEFF;
public const int32 UNICODE_BOM_SWAPPED = 0xFFFE;
@ -51,6 +51,12 @@ namespace SDL2
public const int32 TTF_HINTING_LIGHT = 1;
public const int32 TTF_HINTING_MONO = 2;
public const int32 TTF_HINTING_NONE = 3;
public const int32 TTF_HINTING_LIGHT_SUBPIXEL = 4;
public const int32 TTF_DIRECTION_LTR = 0;
public const int32 TTF_DIRECTION_RTL = 1;
public const int32 TTF_DIRECTION_TTB = 2;
public const int32 TTF_DIRECTION_BTT = 3;
public static void SDL_TTF_VERSION(out SDL.Version X)
{
@ -59,11 +65,17 @@ namespace SDL2
X.patch = SDL_TTF_PATCHLEVEL;
}
[LinkName("TTF_LinkedVersion")]
[LinkName("TTF_Linked_Version")]
public static extern SDL.Version LinkedVersion();
[LinkName("TTF_GetFreeTypeVersion")]
public static extern void GetFreeTypeVersion(int32* major, int32* minor, int32* patch);
[LinkName("TTF_GetHarfBuzzVersion")]
public static extern void GetHarfBuzzVersion(int32* major, int32* minor, int32* patch);
[LinkName("TTF_ByteSwappedUNICODE")]
public static extern void ByteSwappedUNICODE(int32 swapped);
public static extern void ByteSwappedUNICODE(bool swapped);
[LinkName("TTF_Init")]
public static extern int32 Init();
@ -99,6 +111,50 @@ namespace SDL2
int64 index
);
[LinkName("TTF_OpenFontDPI")]
public static extern Font* OpenFontDPI(
char* file,
int32 ptsize,
uint32 hdpi,
uint32 vdpi
);
[LinkName("TTF_OpenFontIndexDPI")]
public static extern Font* OpenFontIndexDPI(
char* file,
int32 ptsize,
int32 index,
uint32 hdpi,
uint32 vdpi
);
[LinkName("TTF_OpenFontDPIRW")]
public static extern Font* OpenFontDPIRW(
SDL.RWOps* src,
int32 freesrc,
int32 ptsize,
uint32 hdpi,
uint32 vdpi
);
[LinkName("TTF_OpenFontIndexDPIRW")]
public static extern Font* OpenFontIndexDPIRW(
SDL.RWOps* src,
int32 freesrc,
int32 ptsize,
int32 index,
uint32 hdpi,
uint32 vdpi
);
[LinkName("TTF_SetFontSizeDPI")]
public static extern int32 SetFontSizeDPI(
Font* font,
int32 ptsize,
uint32 hdpi,
uint32 vdpi
);
public struct Font;
[LinkName("TTF_GetFontStyle")]
@ -119,6 +175,14 @@ namespace SDL2
[LinkName("TTF_SetFontHinting")]
public static extern void SetFontHinting(Font* font, int32 hinting);
[LinkName("TTF_GetFontWrappedAlign")]
public static extern int32 GetFontWrappedAlign(Font* font);
[LinkName("TTF_SetFontWrappedAlign")]
public static extern void SetFontWrappedAlign(Font* font, int32 align);
[LinkName("TTF_FontHeight")]
public static extern int32 FontHeight(Font* font);
@ -152,6 +216,9 @@ namespace SDL2
[LinkName("TTF_GlyphIsProvided")]
public static extern int32 GlyphIsProvided(Font* font, uint16 ch);
[LinkName("TTF_GlyphIsProvided32")]
public static extern int32 GlyphIsProvided32(Font* font, uint32 ch);
[LinkName("TTF_GlyphMetrics")]
public static extern int32 GlyphMetrics(
Font* font,
@ -163,6 +230,17 @@ namespace SDL2
out int32 advance
);
[LinkName("TTF_GlyphMetrics32")]
public static extern int32 GlyphMetrics32(
Font* font,
uint32 ch,
out int32 minx,
out int32 maxx,
out int32 miny,
out int32 maxy,
out int32 advance
);
[LinkName("TTF_SizeText")]
public static extern int32 SizeText(
Font* font,
@ -187,6 +265,33 @@ namespace SDL2
out int32 h
);
[LinkName("TTF_MeasureText")]
public static extern int32 MeasureText(
Font* font,
char8* text,
int32 measure_width,
out int32 extent,
out int32 count
);
[LinkName("TTF_MeasureUTF8")]
public static extern int32 MeasureUTF8(
Font* font,
char8* text,
int32 measure_width,
out int32 extent,
out int32 count
);
[LinkName("TTF_MeasureUNICODE")]
public static extern int32 MeasureUNICODE(
Font* font,
char16* text,
int32 measure_width,
out int32 extent,
out int32 count
);
[LinkName("TTF_RenderText_Solid")]
public static extern SDL.Surface* RenderText_Solid(
Font* font,
@ -208,10 +313,41 @@ namespace SDL2
SDL.Color fg
);
[LinkName("TTF_RenderText_Solid_Wrapped")]
public static extern SDL.Surface* RenderText_Solid_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
uint32 wrapLength
);
[LinkName("TTF_RenderUTF8_Solid_Wrapped")]
public static extern SDL.Surface* RenderUTF8_Solid_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
uint32 wrapLength
);
[LinkName("TTF_RenderUNICODE_Solid_Wrapped")]
public static extern SDL.Surface* RenderUNICODE_Solid_Wrapped(
Font* font,
char16* text,
SDL.Color fg,
uint32 wrapLength
);
[LinkName("TTF_RenderGlyph_Solid")]
public static extern SDL.Surface* RenderGlyph_Solid(
Font* font,
uint16 ch,
uint ch,
SDL.Color fg
);
[LinkName("TTF_RenderGlyph32_Solid")]
public static extern SDL.Surface* RenderGlyph32_Solid(
Font* font,
uint32 ch,
SDL.Color fg
);
@ -239,6 +375,33 @@ namespace SDL2
SDL.Color bg
);
[LinkName("TTF_RenderText_Shaded_Wrapped")]
public static extern SDL.Surface* RenderText_Shaded_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color bg,
uint32 wrappedLength
);
[LinkName("TTF_RenderUTF8_Shaded_Wrapped")]
public static extern SDL.Surface* RenderUTF8_Shaded_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color bg,
uint32 wrappedLength
);
[LinkName("TTF_RenderUNICODE_Shaded_Wrapped")]
public static extern SDL.Surface* RenderUNICODE_Shaded_Wrapped(
Font* font,
char16* text,
SDL.Color fg,
SDL.Color bg,
uint32 wrappedLength
);
[LinkName("TTF_RenderGlyph_Shaded")]
public static extern SDL.Surface* RenderGlyph_Shaded(
Font* font,
@ -247,6 +410,14 @@ namespace SDL2
SDL.Color bg
);
[LinkName("TTF_RenderGlyph32_Shaded")]
public static extern SDL.Surface* RenderGlyph32_Shaded(
Font* font,
uint32 ch,
SDL.Color fg,
SDL.Color bg
);
[LinkName("TTF_RenderText_Blended")]
public static extern SDL.Surface* RenderText_Blended(
Font* font,
@ -299,6 +470,80 @@ namespace SDL2
SDL.Color fg
);
[LinkName("TTF_RenderGlyph32_Blended")]
public static extern SDL.Surface* RenderGlyph32_Blended(
Font* font,
uint32 ch,
SDL.Color fg
);
[LinkName("TTF_RenderText_LCD")]
public static extern SDL.Surface* RenderText_LCD(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color.bg
);
[LinkName("TTF_RenderUTF8_LCD")]
public static extern SDL.Surface* RenderUTF8_LCD(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color.bg
);
[LinkName("TTF_RenderUNICODE_LCD")]
public static extern SDL.Surface* RenderUNICODE_LCD(
Font* font,
char16* text,
SDL.Color fg,
SDL.Color.bg
);
[LinkName("TTF_RenderText_LCD_Wrapped")]
public static extern SDL.Surface* RenderText_LCD_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color.bg,
uint32 wrapLength
);
[LinkName("TTF_RenderUTF8_LCD_Wrapped")]
public static extern SDL.Surface* RenderUTF8_LCD_Wrapped(
Font* font,
char8* text,
SDL.Color fg,
SDL.Color.bg,
uint32 wrapLength
);
[LinkName("TTF_RenderUNICODE_LCD_Wrapped")]
public static extern SDL.Surface* RenderUNICODE_LCD_Wrapped(
Font* font,
char16* text,
SDL.Color fg,
SDL.Color.bg,
uint32 wrapLength
);
[LinkName("TTF_RenderGlyph_LCD")]
public static extern SDL.Surface* RenderGlyph_LCD(
Font* font,
char16 ch,
SDL.Color fg,
SDL.Color.bg
);
[LinkName("TTF_RenderGlyph32_LCD")]
public static extern SDL.Surface* RenderGlyph32_LCD(
Font* font,
char32 ch,
SDL.Color fg,
SDL.Color.bg
);
[LinkName("TTF_CloseFont")]
public static extern void CloseFont(Font* font);
@ -314,5 +559,45 @@ namespace SDL2
int prev_index,
int index
);
[LinkName("TTF_GetFontKerningSizeGlyphs")]
public static extern int32 GetFontKerningSizeGlyphs(
Font* font,
char16 previous_ch,
char16 ch
);
[LinkName("TTF_SetFontSDF")]
public static extern int32 SetFontSDF(
Font* font,
bool on_off
);
[LinkName("TTF_GetFontSDF")]
public static extern bool GetFontSDF(
Font* font
);
[LinkName("TTF_SetDirection")]
public static extern int32 SetDirection(
int direction
);
[LinkName("TTF_SetScript")]
public static extern int32 SetScript(
int script
);
[LinkName("TTF_SetFontDirection")]
public static extern int32 SetFontDirection(
Font* font,
int direction
);
[LinkName("TTF_SetFontScriptName")]
public static extern int32 SetFontScriptName(
Font* font,
char8* script
);
}
}