diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:25:52 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:25:52 +0300 |
| commit | 83c2180348ae4722157e12facfa9cd70c2c955d0 (patch) | |
| tree | eb0780e0c001d6014ab175523ea55cac0dd65a97 | |
| parent | 3c39c55676162f83ed2eaf2fee3ec41254abc638 (diff) | |
Drop the hello draw snippet from the README
The README links to examples/hello.c, so a copy of its draw callback
only goes stale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | README.md | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -49,20 +49,8 @@ explicit backend with `yasl_display_spec.backend`. Include `<yasl/app.h>` and pass application callbacks to `yasl_run()`. The complete [hello.c](examples/hello.c) describes its window in -`yasl_app_desc.window`, lets the runner quit when it is closed, and fills every pixel -in its frame callback: - -```c -static void draw(void *ud, struct yasl_surface *surface, struct yasl_frame_context *frame) -{ - (void)ud; - size_t count = (size_t)frame->size.x * frame->size.y; - for (size_t i = 0; i < count; i++) - frame->cpu.pixels[i] = 0xff306090; - if (!yasl_frame_present_cpu(frame, NULL, 0)) - yasl_surface_destroy(surface); -} -``` +`yasl_app_desc.window`, lets the runner quit when it is closed, and fills every +pixel with an RGB gradient in its frame callback. Toplevel creation sizes are logical pixels; drawing and input use device pixels. Targets are borrowed for one frame callback. Keep durable content in application |
