@@ -407,6 +407,11 @@ pub const io = struct {
407407 extern fn zguiIoAddCharacterEvent (char : c_int ) void ;
408408};
409409
410+ pub const platform_io = struct {
411+ pub const getTextures = zguiPlatformIoGetTextures ;
412+ extern fn zguiPlatformIoGetTextures () * Vector (* TextureData );
413+ };
414+
410415pub fn setClipboardText (value : [:0 ]const u8 ) void {
411416 zguiSetClipboardText (value .ptr );
412417}
@@ -428,15 +433,55 @@ pub const DrawData = *extern struct {
428433 display_size : [2 ]f32 ,
429434 framebuffer_scale : [2 ]f32 ,
430435 owner_viewport : ? * Viewport ,
431- textures : * Vector (TextureIdent ),
436+ textures : * Vector (* TextureData ),
432437};
433438pub const Font = * opaque {};
434439pub const Ident = u32 ;
435440pub const TextureIdent = enum (u64 ) { _ };
436441pub const TextureRef = extern struct {
437- tex_data : ? * anyopaque ,
442+ tex_data : ? * TextureData ,
443+ tex_id : TextureIdent ,
444+ };
445+
446+ pub const TextureStatus = enum (c_int ) {
447+ ok ,
448+ destroyed ,
449+ want_create ,
450+ want_updates ,
451+ want_destroy ,
452+ };
453+
454+ pub const TextureFormat = enum (c_int ) {
455+ rgba32 ,
456+ alpha8 ,
457+ };
458+
459+ pub const TextureRect = extern struct {
460+ x : c_ushort ,
461+ y : c_ushort ,
462+ w : c_ushort ,
463+ h : c_ushort ,
464+ };
465+
466+ pub const TextureData = extern struct {
467+ unique_id : c_int ,
468+ status : TextureStatus ,
469+ backend_user_data : ? * anyopaque ,
438470 tex_id : TextureIdent ,
471+ format : TextureFormat ,
472+ width : c_int ,
473+ height : c_int ,
474+ bytes_per_pixel : c_int ,
475+ pixels : [* ]u8 ,
476+ used_rect : TextureRect ,
477+ update_Rect : TextureRect ,
478+ updates : Vector (TextureRect ),
479+ unused_Frames : c_int ,
480+ ref_count : c_ushort ,
481+ use_colors : bool ,
482+ want_destroy_next_frame : bool ,
439483};
484+
440485pub const Wchar = if (@import ("zgui_options" ).use_wchar32 ) u32 else u16 ;
441486pub const Key = enum (c_int ) {
442487 none = 0 ,
0 commit comments