Write C++ and see the graphics, in your browser or inside VS Code.
Original Turbo C++ behavior, without the manual DOSBox setup.
No account needed to run code · Optional Google cloud sync · Offline build available
Browser / VS Code / Example / Local setup / Developer docs
graphics.h is Borland's classic graphics library, familiar to many students through Turbo C++. This project runs the original TCC.EXE inside DOSBox compiled to WebAssembly, so compilation and execution happen locally in your browser.
| Start in the browser | Stay in your editor |
|---|---|
| Open the compiler and run your first program. | Install the extension and use Ctrl + Alt + N. |
| No installation or account required. | Choose Turbo C++ or native WinBGI output. |
| Open online compiler | Install from Marketplace |
A code editor and graphics output, together in one workspace. Write a program, click Run, and see the result.

CodeMirror 6 with syntax highlighting, autocomplete, parameter hints, and function documentation.
Sign in with Google to save files into folders and access them from another device. Signing in is optional for compiling and running code.

Your programs, organised in a cloud workspace.
Explore browser features
| Feature | What you get |
|---|---|
| Original compiler | Turbo C++ 3.0 running inside DOSBox WASM |
| Graphics reference | Editor documentation for all 99 supported graphics.h functions |
| Cloud workspace | Google sign-in, folders, and file sync across devices |
| Offline support | Compile and run after the required assets have been cached |
| Portable build | A self-contained HTML compiler for offline use |
Tip
Taking it offline? Download the standalone HTML compiler. Keep one file and run it without a server. How the standalone build works.
Compile and run without leaving your editor. Install from the VS Code Marketplace, or use:
code --install-extension AlbatrossC.graphics-h-compilerOpen your C++ file and press Ctrl + Alt + N. Run and stop controls are also available in the status bar.
Run the original compiler and view DOS graphics inside a VS Code webview. Available on Windows, macOS, and Linux.

Classic Turbo C++ behavior, alongside your source code.
Compile with MinGW-w64 (GCC 11.5.0) and open a native graphics window. The extension installs the toolchain on first use; Linux also requires Wine.

Native Windows graphics, with GCC diagnostics in the editor and Problems panel.
| Turbo C++ | WinBGI | |
|---|---|---|
| Best for | Original Turbo C++ programs | WinBGI-compatible programs |
| Compiler | Turbo C++ 3.0 | GCC 11.5.0 / MinGW-w64 |
| Output | Integrated DOSBox webview | Native Win32 window |
| Platforms | Windows, macOS, Linux | Windows; Linux via Wine |
| Setup | No separate DOSBox installation | Automatic toolchain installation; Wine on Linux |
Paste this into the online compiler, or save it as a C++ file in VS Code.
#include <graphics.h>
#include <conio.h>
int main() {
int gd = DETECT, gm;
initgraph(&gd, &gm, "");
setcolor(YELLOW);
circle(320, 240, 100); // Yellow circle
setcolor(LIGHTCYAN);
rectangle(200, 120, 440, 360); // Cyan rectangle
setcolor(LIGHTGREEN);
line(100, 50, 540, 430); // Green diagonal
setcolor(WHITE);
outtextxy(250, 420, "It works!");
getch();
closegraph();
return 0;
}You will need Git, Node.js 18+, and Python 3.
# Clone the project
git clone https://github.com/AlbatrossC/graphics-h-compiler.git
cd graphics-h-compiler
# Install JavaScript and Python dependencies
npm install
python -m pip install -r requirements.txt
# Build the static site into dist/
npm run build
# Serve the result
npx serve distOpen http://localhost:3000/compiler. Cloud authentication and file sync require the API services; see the developer docs for configuration.
Under the hood
| Layer | Technology |
|---|---|
| Compiler engine | Turbo C++ 3.0 via js-dos / DOSBox WASM |
| Code editor | CodeMirror 6 with C++ language support |
| Assets and build | esbuild, Python, and Jinja2 |
| VS Code extension | TypeScript, Webview API, MinGW-w64 |
| Hosting | Cloudflare Pages for the site; Workers for APIs |
| Guide | Contents |
|---|---|
| Online compiler | WASM integration, editor configuration, and deployment |
| VS Code extension | Architecture, compiler modes, and packaging |
| Standalone build | How the self-contained HTML compiler works |
Found a bug or have an idea? Open an issue or send a pull request.
Built by AlbatrossC for everyone who just wants their graphics.h code to run.
If it helped, consider giving the project a star on GitHub.