Your first renderer needs no window
A renderer turns a description into an image. Begin with a file rather than a window, graphics driver, or engine framework. That lets you concentrate on one idea: choosing a color for each pixel. The native project eventually traces a small scene of spheres and a ground plane on the CPU. This first experiment only writes a gradient.
The P3 form of a PPM image is readable text. Its header says P3, then width and height, then the largest channel value. Each pixel contributes three integers: red, green, and blue. The native renderer later uses P6, which has a text header followed by binary RGB bytes. Both are deliberately simple image formats; this first experiment uses P3 so you can read every value.
Our coordinates begin at the upper left. x increases across a row; y increases down the image. The order in which you emit values is part of the contract. A successful compiler invocation cannot tell you whether you swapped two axes.
Run this program locally and inspect both the image and its text. Predict the first and last RGB triples before opening it. The website displays code and models; it does not compile C++ in your browser.
