Skip to content

Commit

Permalink
fixes for imgui 1.91.4 (ImTextureID changed from void* to uint64_t)
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Oct 22, 2024
1 parent 247ad89 commit 1c32876
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ui/ui_bombjack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 6 additions & 4 deletions ui/ui_dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,20 @@ 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 */
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 */
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion ui/ui_snapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ 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
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;

Expand Down

0 comments on commit 1c32876

Please sign in to comment.