Updated GB_set_user_data and GB_get_user_data (markdown)

Lior Halphon 2024-11-26 21:44:28 +02:00
parent 2d96d2e671
commit 303c881f38
2 changed files with 15 additions and 15 deletions

@ -1,15 +0,0 @@
## Definition
<tt>void GB_set_user_data([[GB_gameboy_t]] *gb, void *data);</tt>
<tt>void *GB_get_user_data([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_set_user_data` and `GB_get_user_data` thread-safe and can be called from any thread and context.

@ -0,0 +1,15 @@
## Definition
<tt>void GB_set_user_data([[GB_gameboy_t]] *gb, void *data);</tt>
<tt>void *GB_get_user_data([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
`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.
## Thread Safety
`GB_set_user_data` and `GB_get_user_data` thread-safe and can be called from any thread and context.