Known gaps and what’s next#
This guide covered two dimensions thoroughly and stopped there on purpose. This closing chapter draws the boundary explicitly: what a second version would add, what belongs in separate guides, and where the FFI frontier currently ends. Naming these keeps you from hunting for coverage that is not here, and sets out the road ahead.
The third dimension (planned v2)#
Everything three-dimensional is deferred to a sequel, not omitted by accident. The foundations chapter named the one concept that carries across (the Z-buffer, which decides what is nearest the viewer), and the algorithms chapter noted that tessellation into triangles is the bridge into 3D, but neither went further. A second version would cover:
OpenGL, through a maintained binding, for hardware-accelerated rendering: the modern shader pipeline, vertex and index buffers, and the math (projection, the model-view transform) that turns a 3D scene into a 2D image.
The depth buffer for real, not just the concept: how draw order stops mattering and depth decides visibility.
A 3D game capstone, the third project the original plan named, built on whatever 3D path proves most honest to run at the time.
3D is a large subject and doing it justice needs its own arc; folding a thin version into this guide would have shortchanged both dimensions.
Deliberately out of scope#
Three areas are excluded on purpose and would each be a separate guide, not a chapter here:
GPU programming. Writing compute or graphics shaders and running general-purpose work on the GPU is a distinct discipline with its own toolchain. It touches graphics but is not drawing, and it earns its own treatment.
Computer vision and image analysis. This guide used convolution as a drawing tool (blur, sharpen) and stopped precisely at the line where the same math becomes detection and recognition. Feature detection, segmentation, and recognition are analysis, not drawing, and belong elsewhere.
Hosted image-generation services. Connectors to external image-generation APIs are network and service-integration work, not graphics programming, and are out of scope regardless of dimension.
The FFI frontier#
The reaching-further arc was candid at each step about where pperl’s native FFI currently reaches. Collected here, the frontier is:
The Level 2 data-description layer. Raw
Peta::FFIcalls handle scalars, strings, buffers, and opaque handles, which covers a large part of many C graphics APIs and all of a library like Cairo. What they do not yet describe is a struct passed or returned by value, or a union such as a windowing event record. The declarative data-description layer is being built to close exactly this gap, and it is the missing piece between today’s raw calls and a comfortable binding for struct-heavy libraries.Callbacks. A library that calls back into your code (an event loop invoking a handler, a draw signal) needs a C function pointer that re-enters Perl. That is beyond the raw layer today.
A complete SDL2 binding. The game capstone showed SDL2 is partly reachable now (window and renderer creation, the scalar calls) and blocked on the two items above for the rest (event unions, and ideally callbacks). It is the natural first big curated graphics binding once the data-description layer lands, following the Cairo showcase pattern.
None of these are walls. They are the order in which the FFI is growing, and this guide’s job was to tell you which side of the current line each task sits on.
What you can do now#
Set against the frontier, the ground already covered is broad. With this guide you can, today, on pperl:
Draw raster images with primitives and filters, and read, scale, and save them (Imager, GD and ImageMagick).
Produce resolution-independent vector output, as pixels through Cairo or as markup through SVG (Cairo and SVG).
Read and write image metadata, and draw charts (metadata and charts).
Open a window, respond to the mouse and keyboard, and animate (GUI toolkits).
Reach a scalar-and-handle C graphics library through a curated native binding, with no C compiler and no build step (Cairo showcase).
Build and run real programs: a drawing application and a 2D game.
That is a complete 2D graphics capability in Perl, from the pixel to a running program. The third dimension, the GPU, and the vision side are the roads out from here, and they are on the map.