mirror of https://github.com/LIJI32/SameBoy.git
Updated GB_set_user_data and GB_get_user_data (markdown)
parent
2d96d2e671
commit
303c881f38
|
@ -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.
|
Loading…
Reference in New Issue