Theme Catppuccin
Make yourself at homeCatppuccin

A softer light for long learning sessions.

Appearance

Loading your preference…

Dark palette

Choose a dark palette to try it.

Light uses Latte. Your choices stay in this browser.

The window has tides

SKETCHBOOK / 02 Signal Garden · 2-week chapter

Page 1 of 6: A window lends an image

Presentation is an agreement

A window lends an image

A swapchain is a collection of images managed with the presentation system. You do not own those images in the same way as an offscreen image you allocate. Query surface formats, present modes, image-count limits, supported usage, and extent. Select from what is advertised. The extent is measured in drawable pixels; it need not equal a window size expressed in logical UI units. Choose a clear color before adding geometry so that the first visible milestone has one obvious success condition.

Acquire returns an image index and arranges a synchronization signal. Recording commands does not wait for acquisition, and obtaining the index alone does not make every access safe. Submit work with the acquisition dependency at a stage that protects the first actual use, then signal a semaphore that presentation waits on. The image must be in the layout required by presentation before it is presented. Keep the acquire-submit-present story on paper beside the implementation.

A frame slot is your reusable CPU-side bookkeeping bundle: command buffer, completion fence, and temporary data. Create each initial frame fence with VK_FENCE_CREATE_SIGNALED_BIT so the first wait can finish; alternatively skip that first wait under an explicit never-submitted state. A swapchain image is chosen by acquisition. Two frame slots do not imply two swapchain images, and frame_number modulo image_count is not an acquired image index. Use different variable names and separate containers for these concepts.

From the page to your own work

Your studio assignment.

Make a resilient clear-color window before a triangle.

A finish line you can see

A three-color window with an event/result log and a resize/minimize walkthrough.

  1. Run repeated resize, minimize, restore, and close scenarios.
  2. Use acquired image indices for image-dependent resources.
  3. Keep fence reset after the usable-acquisition decision.
  4. Document presentation-semaphore reuse and old-swapchain retirement.
Keep the evidence in your weekly notebook ↗
Explain it like an engineer

Try answering aloud before opening the review notes. Use your own implementation as evidence.

Why can waiting for a submit fence be insufficient for reusing a presentation semaphore?
  • Submission completion and the presentation operation are distinct.
  • A presentation wait semaphore may remain in use after rendering finishes.
  • Use per-image reuse backed by acquisition, or supported explicit presentation completion.

These prompts support practice; they are not an automatic assessment of your work.

A small creative variation ↗

Add a pause toggle that stops drawing while still servicing window events.

Optional. Save it for later if this chapter already feels full.

Coming back after a break? ↩

Return to a clear-only frame and run one resize. Ignore geometry until the lifecycle is stable.

Books & principles behind this study +

Original Parallax explanations and assignments, with these works for further reading.

YOUR MARGIN NOTES

Leave yourself a good question.

What changed your mind? What would you try next?

Notes are private to this browser and saved as you write.

A CHECKPOINT, NOT A SCORE

Can you explain the idea and try the exercise yourself?

Completion records your own assessment. It does not compile or test your C++.
Companion source 4 files