1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

SDL platform improvements

This commit is contained in:
Brian Fiete 2022-11-10 06:37:55 -08:00
parent d20b53b187
commit 8e191b074b
101 changed files with 37801 additions and 68 deletions

View file

@ -85,6 +85,9 @@ namespace Beefy
[CallingConvention(.Stdcall), CLink]
static extern void BFApp_GetWorkspaceRectFrom(int32 x, int32 y, int32 width, int32 height, out int32 outX, out int32 outY, out int32 outWidth, out int32 outHeight);
[CallingConvention(.Stdcall), CLink]
static extern void BFApp_SetOptionString(char8* name, char8* value);
[CallingConvention(.Stdcall), CLink]
static extern void BFApp_Create();
@ -169,6 +172,10 @@ namespace Beefy
sApp.Update();
}
#endif
public static void SetOption(StringView name, StringView value)
{
BFApp_SetOptionString(name.ToScopeCStr!(), value.ToScopeCStr!());
}
static void Static_Draw(bool forceDraw)
{

View file

@ -209,16 +209,16 @@ namespace Beefy.theme.dark
public static int32 sUnitSize = 20;
public static DarkTheme sDarkTheme ~ delete _;
Image mThemeImage ~ delete _;
Image mThemeImage;
public Image[] mImages = new Image[(int32) ImageIdx.COUNT] ~ delete _;
public Font mHeaderFont ~ delete _;
public Font mSmallFont ~ delete _;
public Font mSmallBoldFont ~ delete _;
public Image mTreeArrow ~ delete _;
public Image mWindowTopImage ~ delete _;
public Image mIconWarning ~ delete _;
public Image mIconError ~ delete _;
public Font mHeaderFont;
public Font mSmallFont;
public Font mSmallBoldFont;
public Image mTreeArrow;
public Image mWindowTopImage;
public Image mIconWarning;
public Image mIconError;
public String[3] mUIFileNames = .(new String(), new String(), new String()) ~
{
@ -231,6 +231,20 @@ namespace Beefy.theme.dark
sDarkTheme = this;
}
public ~this()
{
delete mHeaderFont;
delete mSmallFont;
delete mSmallBoldFont;
delete mTreeArrow;
delete mWindowTopImage;
delete mIconWarning;
delete mIconError;
for (var image in mImages)
delete image;
delete mThemeImage;
}
public static DesignToolboxEntry[] GetDesignToolboxEntries()
{
Get();
@ -414,12 +428,6 @@ namespace Beefy.theme.dark
DarkTooltipManager.UpdateMouseover();
}
public ~this()
{
for (var image in mImages)
delete image;
}
public Image GetImage(ImageIdx idx)
{
return mImages[(int32)idx];