logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

s3d_set_callback - sets a callback

Author

SimonWunderlich
           Author of s3d

s3d                                                                                          S3D_SET_CALLBACK(3)

Description

       Sets a callback for a certain event. this is very useful for event-oriented applications. event callbacks
       will not interrupt each other or the mainloop.

           Warning

           Defining callbacks will only work after calling s3d_init()

            #include <inttypes.h>

            void obj_click(struct s3d_evt event)
            {
                    printf("object id %"PRIu32" got clicked", *((uint32_t *)event->buf));
            }
            ...
            s3d_set_callback(S3D_EVENT_NEW_OBJECT, obj_click);
            // this will tell you when a object got clicked

Name

       s3d_set_callback - sets a callback

Synopsis

#include<s3d.h>voids3d_set_callback(uint8_tevent,s3d_cbfunc);

See Also