Creating Our First Image

Today's goal: create a basic image and render it to a PNG file!

Watch the recording on YouTube!

Updates

  • Thanks to Ashraz, we now have lsp-mode (and eglot) working for the C code!
  • Project Makefiles are now generated by CMake
  • The generated compile_commands.json feeds ccls information about where project dependencies are

Looking Ahead

  • I really want to abandon SDL2 as soon as I can
  • Write my own rendering layer with OpenGL and shaders
  • My goal is to use GLFW to set up rendering context, event loop, and input
  • The plan: get some things working in SDL2 to validate the model, then drop it

Tasks

DONE Figure out why scene flipping doesn't work (event problem?)

DONE Flesh out the approach for calling C functions to communicate scene data

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

DONE Render the image to a .png file

TODO Write a function that can convert HTML-style hex colors to RGBA

TODO Load and render an image file

TODO Figure out how to render basic text on the image

TODO Try to clean up the old scene memory when it's no longer needed

Notes

Results

Here's the image we were able to save today:

Result image

Here is the commit for the code changes from today:

https://github.com/FluxHarmonic/flux-compose/commit/9ea27cdf2cf4940bd09356f8a12f1c9c702f86cf

Next Steps

TODO Figure out why the window isn't the correct size

TODO Figure out how to convert Scheme string to null-terminated bytevector

TODO Finish writing function that can convert HTML-style hex colors to RGBA

TODO Load and render an image file

TODO Figure out how to render basic text on the image

TODO Try to clean up the old scene memory when it's no longer needed