Add gpu.clear

This commit is contained in:
Alessandro Proto 2023-02-19 21:38:11 +01:00
parent 8b32d524de
commit e662e77fa5

View file

@ -134,6 +134,11 @@ public class GPU : IComponent
name = "loadImage", name = "loadImage",
function = L_LoadImage, function = L_LoadImage,
}, },
new()
{
name = "clear",
function = L_Clear,
},
new(), // NULL new(), // NULL
}; };
@ -517,4 +522,16 @@ public class GPU : IComponent
return 3; return 3;
} }
private static int L_Clear(IntPtr state)
{
var L = Lua.FromIntPtr(state);
var c = L.OptInteger(1, 0x000000);
Utils.UnpackRGB((uint)c, out var r, out var g, out var b);
_game.Drawing.Clear(new Color(r, g, b));
return 0;
}
} }