diff --git a/ui/ui_bombjack.h b/ui/ui_bombjack.h index 6136274f..172aa4a3 100644 --- a/ui/ui_bombjack.h +++ b/ui/ui_bombjack.h @@ -72,8 +72,8 @@ typedef struct { bool open; int hovered_palette_column; ui_dbg_texture_callbacks_t texture_cbs; - void* tex_16x16[24]; - void* tex_32x32[24]; + ui_dbg_texture_t tex_16x16[24]; + ui_dbg_texture_t tex_32x32[24]; uint32_t pixel_buffer[1024]; } ui_bombjack_video_t; diff --git a/ui/ui_dbg.h b/ui/ui_dbg.h index b2f59563..b4701502 100644 --- a/ui/ui_dbg.h +++ b/ui/ui_dbg.h @@ -134,6 +134,8 @@ typedef struct ui_dbg_user_breaktype_t { bool show_val16; /* show the value field as word? */ } ui_dbg_breaktype_t; +/* texture handle compatible with Dear ImGui */ +typedef uint64_t ui_dbg_texture_t; /* forward decl */ struct ui_dbg_t; /* callback for reading a byte from memory */ @@ -141,11 +143,11 @@ typedef uint8_t (*ui_dbg_read_t)(int layer, uint16_t addr, void* user_data); /* callback for evaluating uer breakpoints, return breakpoint index, or -1 */ typedef int (*ui_dbg_user_break_t)(struct ui_dbg_t* win, int trap_id, uint64_t pins, void* user_data); /* a callback to create a dynamic-update RGBA8 UI texture, needs to return an ImTextureID handle */ -typedef void* (*ui_dbg_create_texture_t)(int w, int h); +typedef ui_dbg_texture_t (*ui_dbg_create_texture_t)(int w, int h); /* callback to update a UI texture with new data */ -typedef void (*ui_dbg_update_texture_t)(void* tex_handle, void* data, int data_byte_size); +typedef void (*ui_dbg_update_texture_t)(ui_dbg_texture_t tex_handle, void* data, int data_byte_size); /* callback to destroy a UI texture */ -typedef void (*ui_dbg_destroy_texture_t)(void* tex_handle); +typedef void (*ui_dbg_destroy_texture_t)(ui_dbg_texture_t tex_handle); /* callback when emulator is being rebootet */ typedef void (*ui_dbg_reboot_t)(void); /* callback when emulator is being reset */ @@ -270,7 +272,7 @@ typedef struct ui_dbg_heatmap_t { int tex_width, tex_height; int tex_width_uicombo_state; int next_tex_width; - void* texture; + ui_dbg_texture_t texture; bool show_ops, show_reads, show_writes; int autoclear_interval; /* 0: no autoclear */ int scale; diff --git a/ui/ui_snapshot.h b/ui/ui_snapshot.h index d409b256..a39c2cad 100644 --- a/ui/ui_snapshot.h +++ b/ui/ui_snapshot.h @@ -51,6 +51,8 @@ extern "C" { #define UI_SNAPSHOT_MAX_SLOTS (8) +// Dear ImGui compatible texture handle +typedef uint64_t ui_snapshot_texture_t; // callback function to save snapshot to a numbered slot typedef void (*ui_snapshot_save_t)(size_t slot_index); // callback function to load snapshot from numbered slot @@ -58,7 +60,7 @@ typedef bool (*ui_snapshot_load_t)(size_t slot_index); // a snapshot screenshot wrapper struct typedef struct { - void* texture; + ui_snapshot_texture_t texture; bool portrait; } ui_snapshot_screenshot_t;