Introduction into cl-bodge graphics system

This step-by-step guide will introduce you to cl-bodge graphics API provided by
cl-bodge/graphics system starting with core concepts first and introducing more complex
notions later.

cl-bodge/graphics overview

In Common Lisp, function format allows you to print formatted strings into character streams:
it renders template string into an output by filling control placeholders with supplied
arguments. cl-bodge adapts this concept for graphics with function render:

output argument is often the target framebuffer for the rendering we want to perform into. If
you pass t as output rendering will be performed into default framebuffer just like format
would render string into standard output. But you also can provide texture as a target! All the
machinery required to render directly into texture cl-bodge will handle for you.

pipeline is an object representing rendering operation and input is a list of key-value
pairs to control pipeline behavior.

Now, output is a framebuffer or a texture, but what is pipeline then? It can be various
things, but cl-bodge/graphics system exposes only one: shader pipeline.

Shader pipelines are defined with defpipeline macro and assembled from shaders using
make-shader-pipeline function. Unlike various CL graphics libraries (e.g. CEPL) cl-bodge
shaders are written directly in GLSL. But fear not, live reload of GLSL sources is supported (we
will discuss related configuration later), so you can play with shader output in live
session. Shaders are defined with defshader macro.

Summing up, to display something via cl-bodge\graphics:

Define shaders

Define a pipeline

Make a pipeline object

Optionally, make a framebuffer

Pass a framebuffer, a pipeline and pipeline arguments to render function

Guide How-To

This guide is written in literate programming style - documentation is your code. You can
evaluate provided examples block-by-block in your Common Lisp REPL of choice, or use org-mode
to do the same in a more convenient fasion or execute all code blocks in a buffer at once, or,
ultimately, you can just load any system described below in ASDF definitions section and call
appropriate run-example functions.

Preparations

Just right before digging deeper into cl-bodge, lets make little preparations by loading
required dependencies and defining a few of helper functions that will help us in our future
adventures.