diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2025-01-14 06:33:54 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2025-01-14 06:33:54 +0100 |
commit | dced6f7768e02252af11f9b41017d75c66b47d81 (patch) | |
tree | 008f4cb816a09b776013d5903b34fb89c01cf042 /examples/particles.c | |
parent | c9208089c6074575342d529f494295c13269a1aa (diff) | |
download | reduced_system_layer-dced6f7768e02252af11f9b41017d75c66b47d81.zip |
Correct examples for changed graphics procs
Diffstat (limited to 'examples/particles.c')
-rw-r--r-- | examples/particles.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/particles.c b/examples/particles.c index 37a77a5..03c51f7 100644 --- a/examples/particles.c +++ b/examples/particles.c @@ -14,7 +14,7 @@ typedef struct { } World; World world = {0}; -vec3_f32 background = { .0f, .0f, .08f }; +vec4_f32 background = { .0f, .0f, .08f, 1.f }; i64 time_0; void update_and_render_frame(void) { @@ -100,7 +100,7 @@ void update_and_render_frame(void) { if (i < 0 || i >= g_platform.frame_width) continue; if ((i - x) * (i - x) + (j - y) * (j - y) > 100) continue; f64 v = (e->vx * e->vx + e->vy * e->vy) * 8.; - g_platform.pixels[j * g_platform.frame_width + i] = (vec3_f32) { -.2 + v * 2., .1 + v * .7, 1. - v }; + g_platform.pixels[j * g_platform.frame_width + i] = (vec4_f32) { -.2 + v * 2., .1 + v * .7, 1. - v, 1.f }; } } } @@ -113,9 +113,8 @@ i32 main(i32 argc, c8 **argv) { (void) argv; g_platform = (Platform) { - .title = "Gravity", - .frame_width = 960, - .frame_height = 720, + .title = "Particles", + .exact_resolution = 1, }; time_0 = p_time(); |