S3DW_ANI_MATE(3)

πŸ’– S3DW_ANI_MATE πŸ’–

okay bestie, so this is a page from the s3d Manual, section 3 β€” and it's about s3dw_ani_mate, the lil function that does the whole animation thing. yes, that's literally what the NAME says. we love a self-aware icon.


✨ NAME ✨

s3dw_ani_mate β€” doing the whole animation thing πŸ¦‹


🌸 SYNOPSIS 🌸

#include <s3dw.h>

void s3dw_ani_mate(void);

πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea: just call this bad boy in your mainloop if you want some nice window sliding animations. that's it. that's the whole job. πŸ’…

it's somewhat bloating, ngl β€” but you don't want to miss it ;) fr fr, it's giving "worth it".

here's how it looks in the wild:

#include <time.h>   // nanosleep()
static struct timespec t={0.33*1000*1000}; // 33 mili seconds
void mainloop()
{
        // keep this in your mainloop. this will do smooth animations for you ...
        s3dw_ani_mate();
        nanosleep(&t,NULL);
}

....
s3d_mainloop(mainloop);

so yeah β€” you keep s3dw_ani_mate(); sitting right there in your mainloop, and it will do smooth animations for you. no cap. ✨ the nanosleep with that t is your lil 33 mili seconds breather so everything stays buttery instead of absolutely unhinged. 🧚

lowkey important: that static struct timespec t={0.33*1000*1000}; is the 33 mili seconds, and the nanosleep(&t,NULL); goes inside the mainloop. keep the whole vibe together or the smoothness simply does not happen. πŸ™ˆ

and then you hand it off to s3d_mainloop(mainloop); and let it cook. πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d


mwah πŸ’‹ that's the whole page, bestie β€” straight outta the s3d manual, section 3, S3DW_ANI_MATE(3). go make those windows slide. periodt. πŸ’œβœ¨