mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Bugfix gpu not pushing a GPUBuffer
This commit is contained in:
parent
7628d4a29e
commit
f9a88f39bb
1 changed files with 19 additions and 4 deletions
|
@ -410,10 +410,18 @@ public class GPU : IComponent
|
||||||
{
|
{
|
||||||
var L = Lua.FromIntPtr(state);
|
var L = Lua.FromIntPtr(state);
|
||||||
|
|
||||||
|
|
||||||
var buffer = new uint[_game.Width * _game.Height];
|
var buffer = new uint[_game.Width * _game.Height];
|
||||||
_game.Drawing.Canvas.GetData(buffer);
|
_game.Drawing.Canvas.GetData(buffer);
|
||||||
|
|
||||||
ObjectManager.PushObject(L, buffer);
|
var gpuBuffer = new GPUBufferMeta.GPUBuffer
|
||||||
|
{
|
||||||
|
Buffer = buffer,
|
||||||
|
Width = _game.Width,
|
||||||
|
Height = _game.Height,
|
||||||
|
};
|
||||||
|
|
||||||
|
ObjectManager.PushObject(L, gpuBuffer);
|
||||||
L.SetMetaTable(GPUBufferMeta.ObjectType);
|
L.SetMetaTable(GPUBufferMeta.ObjectType);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -434,12 +442,19 @@ public class GPU : IComponent
|
||||||
{
|
{
|
||||||
var L = Lua.FromIntPtr(state);
|
var L = Lua.FromIntPtr(state);
|
||||||
|
|
||||||
var width = L.OptInteger(1, _game.Width);
|
var width = (int)L.OptInteger(1, _game.Width);
|
||||||
var height = L.OptInteger(2, _game.Height);
|
var height = (int)L.OptInteger(2, _game.Height);
|
||||||
|
|
||||||
var buffer = new uint[width * height];
|
var buffer = new uint[width * height];
|
||||||
|
|
||||||
ObjectManager.PushObject(L, buffer);
|
var gpuBuffer = new GPUBufferMeta.GPUBuffer
|
||||||
|
{
|
||||||
|
Buffer = buffer,
|
||||||
|
Width = width,
|
||||||
|
Height = height,
|
||||||
|
};
|
||||||
|
|
||||||
|
ObjectManager.PushObject(L, gpuBuffer);
|
||||||
L.SetMetaTable(GPUBufferMeta.ObjectType);
|
L.SetMetaTable(GPUBufferMeta.ObjectType);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue