started adding gpu support

This commit is contained in:
unknown
2026-09-09 15:26:36 -05:00
parent 0decb483fe
commit 45650cdc0f
21 changed files with 36 additions and 11 deletions
+22 -8
View File
@@ -18,9 +18,10 @@ namespace Core
public int pointer = 0;
// Declare them here without `new int[WindowSize]`
public int[] PixBufferR;
public int[] PixBufferG;
public int[] PixBufferB;
public int[,] PixBufferR;
public int[,] PixBufferG;
public int[,] PixBufferB;
public int[] ColorBuffer = new int[3];
public int f_IsEqu;
public int f_IsZer;
@@ -28,11 +29,6 @@ namespace Core
public Operations(int pixBufSize)
{
WindowSize = pixBufSize;
// Initialize them here so they use the correct WindowSize
PixBufferR = new int[WindowSize];
PixBufferG = new int[WindowSize];
PixBufferB = new int[WindowSize];
}
@@ -50,6 +46,8 @@ namespace Core
return StackY;
case "f_IsEqual":
return f_IsEqu;
case "f_IsZero":
return f_IsZer;
}
Variables.TryGetValue(shite, out int a);
return a;
@@ -147,6 +145,16 @@ namespace Core
Accumulator = StackX / StackY;
return;
// drawing
case ComponentType.CPXBF:
ExecuteCommand(ComponentType.SVAR, new[] { args[1], WindowSize.ToString() });
PixBufferR = new int[WindowSize, WindowSize];
PixBufferG = new int[WindowSize, WindowSize];
PixBufferB = new int[WindowSize, WindowSize];
return;
case ComponentType.DCLR:
ColorBuffer = new int[] { args[1] };
// Debug commands
@@ -225,6 +233,12 @@ namespace Core
case "MUL": ExecuteCommand(ComponentType.MUL, tokens); break;
case "DIV": ExecuteCommand(ComponentType.DIV, tokens); break;
// drawing
case "CPXBF": break; // create pixel buffer
case "PBSET": break; // set a pixel in the buffer
case "PBCLEAR": break; // clear buffer
case "DCLR": break; // set draw color
// Debug
case "PRA": ExecuteCommand(ComponentType.PRA, tokens); break;
case "PRX": ExecuteCommand(ComponentType.PRX, tokens); break;