-
-
Notifications
You must be signed in to change notification settings - Fork 217
GB_set_user_data and GB_get_user_data
Lior Halphon edited this page Nov 30, 2024
·
2 revisions
void GB_set_user_data(GB_gameboy_t *gb, void *data);
void *GB_get_user_data(GB_gameboy_t *gb);
In gb.h
GB_set_user_data
can associate an arbitrary pointer with an emulator instance, and GB_get_user_data
can read the associated pointer back. They can be used by a frontend that can handle multiple emulator instances to associate an emulator instance with its frontend data (For example, a window object that displays the screen of the instance) and read it back when getting callbacks.
GB_set_user_data
and GB_get_user_data
are thread-safe and can be called from any thread and context.