In this first part we lay the groundwork for the quadtree art project.
We focus on setting up a basic SDL environment, a framebuffer and loading an image using stb_image.h
. There is no subdivision logic yet. We are simply preparing to draw.
What You’ll Learn
- How to set up a window, renderer, and texture using SDL3
- How to load an image using
stb_image.h
- How to allocate and update a manual framebuffer
- The foundation for building an interactive image renderer in C23
Why It Matters
Every graphics project needs a solid foundation.
This part ensures we can:
- Read an image from disk
- Display a dynamic texture
- Prepare for manual pixel drawing using a framebuffer
Project Code
You will find the complete source code here: quadtree-art
If everything is set up correctly you should see the input image drawn using the framebuffer.
External Resources
Acknowledgements
- Quads by Michael Fogleman - original idea
Next Up
In part 2 we will build the actual quadtree by subdividing the image region by region.