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
feedsccls
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
- Creating a "screenshot" of an SDL2 renderer: https://gist.github.com/malja/2193bd656fe50c203f264ce554919976
Results
Here's the image we were able to save today:
Here is the commit for the code changes from today:
https://github.com/FluxHarmonic/flux-compose/commit/9ea27cdf2cf4940bd09356f8a12f1c9c702f86cf