This is a high-level HID driver facilitating USB communication with Framework Laptop 16 running Sparkle Firmware.
- Clone the project recursively. It uses Hideous as its HID backend.
- Reference the library in your project.
- Follow the examples.
NOTE
Issuing a lot of direct draw requests directly might result in poor performance. Consider using frame-buffering and pushing an entire frame at once.
usingStarlight.Framework;/* * Will be empty if none found. */vardisplays=LedDisplay.Enumerate();foreach(vardisplayindisplays){display.SetGlobalBrightness(255);display.Clear();display.DrawLine(0,0,display.Width-1,display.Height-1,255);}Single-display renderer proxies all draw calls and uses frame buffering to improve rendering performance.
usingSystem.Threading;usingStarlight.Framework;usingStarlight.Framework.Graphics;vardisplay=LedDisplay.Enumerate()[0];varsdr=newSingleDisplayRenderer(display);while(true){sdr.Clear();for(vary=0;y<sdr.Height;y++){sdr.Line(0,y,sdr.Width-1,y,255);}sdr.PushFramebuffer();Thread.Sleep(16);// roughly 60 FPS, you can lower this if you wanna be fancy}Dual-display renderer allows you to treat your two LED displays as if they were a single, large LED matrix. It requires the user to manually arrange the displays. Or not, for an artistic effect or something.
usingSystem.Threading;usingStarlight.Framework;usingStarlight.Framework.Graphics;vardisplays=LedDisplay.Enumerate();varddr=newDualDisplayRenderer();ddr.Arrange(left:displays[0],right:displays[1]);while(true){ddr.Clear();for(vary=0;y<ddr.Height;y++){ddr.Line(0,y,ddr.Width-1,y,255);}ddr.PushFramebuffer();Thread.Sleep(16);}