Creating the Graphics Layer

View the code: https://github.com/FluxHarmonic/flux-compose

Schedule Change!

Starting next week I'm moving the stream start time forward by one hour.

Streams will now be Tuesday and Thursday, 2PM - 5PM UTC!

Graphics Layer Design

Let's continue with the idea we came up with last time to see how far we can take it:

  • Use a retained mode rendering model
  • Describe the graphics to be rendered in the Scheme layer
  • The C layer will interpret and render the complete scene or instruction list efficiently
  • The Scheme layer can replace the graphics instructions at any time (REPL-based "drawing")
  • Animations will eventually be possible by describing changes to elements in the scene over time

The goal today is to get some basic things rendering in a preview window and possibly save it out to a .png file.

Tasks

Here's what I'd like to accomplish today:

DONE Rename the project to flux-compose

DONE Create a shared library for core C code

DONE Try a FFI approach for calling C functions from a shared library

DONE Get the screen clearing

DONE Find a faster way to iterate on the native layer

DONE Get something simple rendering in the C code

DONE Figure out why init-graphics is crashing the process, can we come up with a good debugging strategy (running via gdb)

TODO Transmit drawing instructions to renderer thread in some form

TODO Get the basic-gfx.scm example working

TODO Render the completed image to a .png file

Next Steps

TODO Try to finish instantiating a test scene in C (use Gan's example)

TODO Figure out how to create the C struct representation for scene objects in Scheme

TODO Transmit drawing instructions to renderer thread in some form (SDL event?)

TODO Get the basic-gfx.scm example working

TODO Make sure that we can re-eval the Scheme code to update the live preview

TODO Render the completed image to a .png file