diff options
Diffstat (limited to 'README.md')
| -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 |
