About graphics.h Compiler

A modern, zero-setup way to run legacy C graphics programs — directly in your browser or VS Code.

Last updated: June 19, 2026

graphics.h Compiler is an educational platform dedicated to helping students learn computer graphics programming without the complexity of legacy software installation and configuration. The website is intended for educational and learning purposes and is used by students studying computer graphics concepts and laboratory coursework.

What is graphics.h & The Problem

What is graphics.h? It is a classic C/C++ graphics library (the Borland Graphics Interface, or BGI) used to draw shapes, lines, and text in a console environment. Originally introduced in the late 1980s and early 1990s, it was designed for DOS-based compilers like Turbo C.

Despite being decades old, this legacy library is still widely taught in Computer Graphics lab courses at universities all over the world, including my own university, SPPU (Savitribai Phule Pune University). It remains a standard introduction to fundamental graphics concepts and algorithms, such as DDA, Bresenham's line drawing, circle generation, and polygon filling.

The Problem? Running graphics.h programs on modern systems is a painful experience. Because the library is a 16-bit legacy component, it cannot run natively on modern 64-bit operating systems like Windows 10/11, macOS, or Linux. Students face frustrating problems depending on their setup:

  • Turbo C / DOSBox Problems: Dealing with resolution scaling glitches, mounting errors, emulator crashes, and losing work due to a lack of autosave or tab completion.
  • Dev-C++ & Code::Blocks Problems: Manual folder structures, downloading external files, configuring cryptic linker parameters (like -lbgi -lgdi32), and constant linker errors.
  • VS Code Problems: Configuring paths, tasks, and compiler settings for C/C++ projects, which is highly frustrating for beginners.
  • Modern Operating System Crashing: Emulator scaling issues and compatibility failures on modern systems.

Consequently, students spend hours debugging environment setups and configuration issues rather than actually learning graphics programming. Many get frustrated or copy lab assignments without understanding how the code works.


The Solution

This website makes it incredibly easy to write, compile, and run graphics.h code. I created this compiler to remove all configuration friction, providing two modern paths to get programs running instantly with zero setup:

🌐

Online Web Compiler

Write and execute graphics.h code directly in your web browser. Zero setup — features a modern code editor, built-in templates, and optional cloud saving with Google Sign-In.

💻

VS Code Extension

Prefer working locally? Install the VS Code extension to get one-click compiling, run capabilities, syntax highlighting, and auto-complete right inside your editor.

Both tools enable your graphics.h programs to run instantly, producing the classic DOS-style graphical window output. You can render circles, lines, rectangles, and text without any software setups. See the full function reference.


How It Works

The online compiler runs entirely inside your browser. To keep your work secure, no code is ever uploaded to or compiled on a server. Instead, the entire compilation pipeline runs client-side using WebAssembly:

When you click **Compile & Run**, the site initializes JS-DOS (a WebAssembly port of the DOSBox emulator). Inside this sandboxed WebAssembly container, it mounts a virtual filesystem containing a complete Turbo C 3.0 installation.

The compiler writes your C++ code into the virtual drive and compiles it using the real Turbo C command-line compiler (TCC.EXE). If compilation succeeds, the executable runs, and the emulator draws the DOS VGA video memory directly onto a standard HTML5 <canvas> element.

Because this client-side compiler uses the actual Turbo C compiler (TCC.EXE) and BGI graphics library under the hood, all standard functions — including initgraph(), circle(), line(), setcolor(), and all 40+ functions — work natively because it is compiled by Turbo C itself.


Tech Stack

The project is built with a modern web stack while preserving legacy Turbo C compatibility:

  • JavaScript
  • HTML / CSS
  • Turbo C 3.0
  • DOSBox
  • Cloudflare Workers
  • Cloudflare D1
  • Cloudflare Pages
  • Google OAuth 2.0
  • CodeMirror 6

The static site is hosted on Cloudflare Pages. Authentication and file storage are powered by Cloudflare Workers, and the code editor uses CodeMirror 6. The full source code is available on GitHub.


Who Made This

This project was built by Soham Jadhav (AlbatrossC on GitHub).

I am a student of SPPU (Savitribai Phule Pune University) who was facing this exact setup issue firsthand during my own computer graphics lab coursework, which drove me to create a seamless tool that eliminates the environment setup struggle for fellow students.

My goal is simple: let students focus on learning graphics programming concepts, not dealing with 1990s software setups. Whether you are working on your college lab assignments or exploring graphics for fun, this tool is designed to make the process completely friction-free.


Open Source

The entire project is open source under the MIT license. You can view the source code, contribute features, report bugs, or fork it for your own use.


Frequently Asked Questions

Is this compiler free to use?

Yes, completely free. The online compiler and VS Code extension are both free and open source under the MIT license.

Do I need to install anything?

No. The online compiler works entirely in your browser. For the VS Code extension, just install it from the VS Code Marketplace.

Can I save my files?

Yes. Sign in with Google in the online compiler to save your files to the cloud and access them from any device.

Can I embed the compiler on my website?

Yes. I provide a simple JavaScript SDK for embedding. See the Embed API documentation for instructions.