3.34. s3d_set_callback

#include <s3d.h>

int s3d_set_callback( unsigned char event s3d_cb func );

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.

Important

Defining callbacks will only work after calling s3d_init()


void obj_click(struct s3d_evt event)
{
	printf("object id %d got clicked", *((unsigned long *)event->buf));
}
...
	s3d_set_callback(S3D_EVENT_NEW_OBJECT, obj_click);

/* this will tell you when a object got clicked */