c_api_gui.h - Engine C API Reference

c_api_gui.h
  1. #pragma once
  2. #include "c_api_types.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. struct GuiCApi
  7. {
  8. unsigned (*triangle) (GuiPtr, ConstVector3Ptr p0, ConstVector3Ptr p1, ConstVector3Ptr p2, unsigned layer, ConstVector4Ptr optional_color,
  9. MaterialPtr optional, ConstVector2Ptr optional_uv0, ConstVector2Ptr optional_uv1, ConstVector2Ptr optional_uv2);
  10. void (*update_triangle) (GuiPtr, unsigned id, ConstVector3Ptr p0, ConstVector3Ptr p1, ConstVector3Ptr p2, unsigned layer, ConstVector4Ptr optional_color);
  11. void (*destroy_triangle) (GuiPtr, unsigned id);
  12. unsigned (*rect) (GuiPtr, ConstVector2Ptr position, unsigned layer, ConstVector2Ptr size, ConstVector4Ptr optional_color, MaterialPtr optional_material);
  13. void (*update_rect) (GuiPtr, unsigned id, ConstVector2Ptr position, unsigned layer, ConstVector2Ptr size, ConstVector4Ptr optional_color);
  14. void (*destroy_rect) (GuiPtr, unsigned id);
  15. unsigned (*rect_3d) (GuiPtr, ConstMatrix4x4Ptr transform, ConstVector3Ptr position, unsigned layer, ConstVector2Ptr size, ConstVector4Ptr optional_color, MaterialPtr optional_material);
  16. void (*update_rect_3d) (GuiPtr, unsigned id, ConstMatrix4x4Ptr transform, ConstVector3Ptr position, unsigned layer, ConstVector2Ptr size, ConstVector4Ptr optional_color);
  17. void (*destroy_rect_3d) (GuiPtr, unsigned id);
  18. unsigned (*bitmap) (GuiPtr, MaterialPtr, ConstVector2Ptr position, unsigned layer, ConstVector2Ptr size, ConstVector4Ptr optional_color, ConstVector2Ptr optional_uv00, ConstVector2Ptr optional_uv11);
  19. void (*update_bitmap) (GuiPtr, unsigned id, MaterialPtr, ConstVector2Ptr position, unsigned layer,
  20. ConstVector2Ptr size, ConstVector4Ptr optional_color, ConstVector2Ptr optional_uv00, ConstVector2Ptr optional_uv11);
  21. void (*destroy_bitmap) (GuiPtr, unsigned id);
  22. unsigned (*bitmap_3d) (GuiPtr, ConstMatrix4x4Ptr transform, MaterialPtr, ConstVector3Ptr position, unsigned layer, ConstVector2Ptr size,
  23. ConstVector4Ptr optional_color, ConstVector2Ptr optional_uv00, ConstVector2Ptr optional_uv11);
  24. void (*update_bitmap_3d) (GuiPtr, unsigned id, ConstMatrix4x4Ptr transform, MaterialPtr, ConstVector3Ptr position, unsigned layer,
  25. ConstVector2Ptr size, ConstVector4Ptr optional_color, ConstVector2Ptr optional_uv00, ConstVector2Ptr optional_uv11);
  26. void (*destroy_bitmap_3d) (GuiPtr, unsigned id);
  27. unsigned (*text) (GuiPtr, const char* text, uint64_t font, float font_size, MaterialPtr, ConstVector2Ptr position, unsigned layer, float letter_spacing, ConstVector4Ptr optional_color);
  28. void (*update_text) (GuiPtr, unsigned id, const char* text, uint64_t font, float font_size, MaterialPtr, ConstVector2Ptr position, unsigned layer, float letter_spacing, ConstVector4Ptr optional_color);
  29. void (*destroy_text) (GuiPtr, unsigned id);
  30. unsigned (*text_3d) (GuiPtr, const char* text_3d, uint64_t font, float font_size, MaterialPtr, ConstMatrix4x4Ptr transform,
  31. ConstVector3Ptr position, unsigned layer, ConstVector4Ptr optional_color, float letter_spacing);
  32. void (*update_text_3d) (GuiPtr, unsigned id, const char* text, uint64_t font, float font_size, MaterialPtr, ConstMatrix4x4Ptr transform,
  33. ConstVector3Ptr position, unsigned layer, ConstVector4Ptr optional_color, float letter_spacing);
  34. void (*destroy_text_3d) (GuiPtr, unsigned id);
  35. struct TextExtentsResult (*text_extents) (GuiPtr, const char* text, uint64_t font, float font_size, float letter_spacing);
  36. /* Fills the row_length_buffer with the length of each row after having processed the text with word wrapping.
  37. Returns the total number of rows. */
  38. unsigned (*word_wrap) (GuiPtr, const char* text, uint64_t font, float font_size, float width, const char* whitespace,
  39. const char* soft_dividers, const char* return_dividers, float letter_spacing, unsigned* row_length_buffer, unsigned buffer_size);
  40. unsigned (*video)(GuiPtr gui_pointer, VideoPlayerPtr video_player, MaterialPtr material_pointer,
  41. ConstVector2Ptr pos, unsigned layer, ConstVector2Ptr opt_size, ConstVector4Ptr opt_color);
  42. void (*update_video)(GuiPtr gui_pointer, unsigned id, VideoPlayerPtr video_player, MaterialPtr material_pointer,
  43. ConstVector2Ptr pos, unsigned layer, ConstVector2Ptr opt_size, ConstVector4Ptr opt_color);
  44. void (*destroy_video)(GuiPtr gui_pointer, unsigned id);
  45. unsigned (*video_3d)(GuiPtr gui_pointer, VideoPlayerPtr video_player, ConstMatrix4x4Ptr transform, MaterialPtr material_pointer,
  46. ConstVector3Ptr pos, unsigned layer, ConstVector2Ptr opt_size, ConstVector4Ptr opt_color);
  47. void (*update_video_3d)(GuiPtr gui_pointer, unsigned id, VideoPlayerPtr video_player, ConstMatrix4x4Ptr transform, MaterialPtr material_pointer,
  48. ConstVector3Ptr pos, unsigned layer, ConstVector2Ptr opt_size, ConstVector4Ptr opt_color);
  49. void (*destroy_video_3d)(GuiPtr gui_pointer, unsigned id);
  50. void (*set_visible) (GuiPtr, int visible);
  51. int (*is_visible) (GuiPtr);
  52. MaterialPtr (*material)(GuiPtr gui_pointer, uint64_t material_id64, const char *optional_debug_material_name);
  53. MaterialPtr (*create_material)(GuiPtr gui_pointer, uint64_t material_id64, const char *optional_debug_material_name);
  54. int (*has_all_glyphs) (GuiPtr, const char* text, uint64_t font);
  55. void (*move) (GuiPtr, float x, float y);
  56. void (*move_3d) (GuiPtr, ConstMatrix4x4Ptr transform);
  57. void (*reset) (GuiPtr);
  58. void (*resolution) (ViewportPtr optional_viewport, ConstWindowPtr optional_window, unsigned int *out_width, unsigned int *out_height);
  59. CApiMatrix4x4 (*rotation_2d) (ConstVector2Ptr position_pointer, float angle, ConstVector2Ptr optional_pivot);
  60. /* Equivalent to vector4(255, r, g, b). */
  61. CApiVector4 (*color_rgb) (float r, float g, float b);
  62. /* Equivalent to vector4(a, r, g, b). */
  63. CApiVector4 (*color_argb) (float a, float r, float g, float b);
  64. unsigned(*get_id) (GuiPtr);
  65. void (*set_video_playback_speed)(VideoPlayerPtr video_player, float speed);
  66. void (*set_video_loop)(VideoPlayerPtr video_player, unsigned loop);
  67. unsigned (*video_has_audio)(VideoPlayerPtr video_player);
  68. StreamSourcePtr (*video_sound_stream_source)(VideoPlayerPtr video_player);
  69. void (*set_video_sound_stream_enabled)(VideoPlayerPtr video_player, unsigned enabled);
  70. unsigned (*video_number_of_frames)(VideoPlayerPtr video_player);
  71. unsigned (*video_current_frame)(VideoPlayerPtr video_player);
  72. unsigned (*video_times_looped)(VideoPlayerPtr video_player);
  73. /* Not available in Release builds. */
  74. unsigned (*texture_size) (uint64_t resource_id64, unsigned int *out_width, unsigned int *out_height);
  75. GuiThumbnailPtr (*thumbnail_load_texture)(unsigned num_textures, uint64_t* names_id64);
  76. GuiThumbnailPtr (*thumbnail_load_dds)(const char *path, uint64_t name_id64);
  77. void (*thumbnail_unload)(GuiThumbnailPtr thumbnail);
  78. };
  79. #ifdef __cplusplus
  80. }
  81. #endif