cosmos c# gui cursor code example
Example: cosmos c# gui cursor
public static VGAScreen VScreen = new VGAScreen();
Console.WriteLine("Vga Driver Booting");
VScreen.SetGraphicsMode(VGAScreen.ScreenSize320x200, VGAScreen.ColorDepth.BitDepth8);
VScreen.Clear(0);
Console.WriteLine("Vga Driver Booted");
VScreen.SetPixel320x200x8((uint) x, (uint) y, (uint) c);
public static byte[] SBuffer = new byte[64000];
public static void SetPixel(int x, int y, int color)
{
SBuffer[(y*320) + x] = (byte)color;
}
public static void ReDraw()
{
// VScreen.Clear(0);
int c = 0;
for (int y = 0; y < 200; y++)
{
for (int x = 0; x < 320; x++)
{
uint cl = VScreen.GetPixel320x200x8((uint) x, (uint) y);
if (cl != (uint)SBuffer[c])
{
VScreen.SetPixel320x200x8((uint) x, (uint) y, SBuffer[c]);
}
c++;
}
}
for (int i = 0; i < 64000; i++)
{
SBuffer[i] = 0;
}
}
public static Mouse m = new Mouse();
public static class BootManager
{
public static void Boot()
{
Screen.Boot();
Desktop.m.Initialize(320, 200);
}
}
Screen.SetPixel(m.X,m.Y,40);
Screen.SetPixel(m.X+ 1,m.Y,40);
Screen.SetPixel(m.X + 2, m.Y, 40);
Screen.SetPixel(m.X, m.Y + 1, 40);
Screen.SetPixel(m.X, m.Y + 2, 40);
Screen.SetPixel(m.X+ 1, m.Y + 1, 40);
Screen.SetPixel(m.X + 2, m.Y + 2, 40);
Screen.SetPixel(m.X +3 , m.Y +3, 40);