#includeint main() { GraphicsContext gc; gc.createWindow(800, 600, "My Window"); while (gc.isWindowOpen()) { gc.processEvents(); } return 0; }
#includeThis code creates a new window and draws a red rectangle with a black background. The `display()` method is used to show the changes on the screen, and the `processEvents()` method is again called in a loop to handle user events. Package library: GraphicsContext is a custom library and not part of any package manager or library repositories.int main() { GraphicsContext gc; gc.createWindow(800, 600, "My Window"); while (gc.isWindowOpen()) { gc.clear(Color::BLACK); gc.drawRect(100, 100, 200, 200, Color::RED, 2); gc.display(); gc.processEvents(); } return 0; }