sokol_imgui.h 169 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147
  1. #if defined(SOKOL_IMPL) && !defined(SOKOL_IMGUI_IMPL)
  2. #define SOKOL_IMGUI_IMPL
  3. #endif
  4. #ifndef SOKOL_IMGUI_INCLUDED
  5. /*
  6. sokol_imgui.h -- drop-in Dear ImGui renderer/event-handler for sokol_gfx.h
  7. Project URL: https://github.com/floooh/sokol
  8. Do this:
  9. #define SOKOL_IMPL or
  10. #define SOKOL_IMGUI_IMPL
  11. before you include this file in *one* C or C++ file to create the
  12. implementation.
  13. NOTE that the implementation can be compiled either as C++ or as C.
  14. When compiled as C++, sokol_imgui.h will directly call into the
  15. Dear ImGui C++ API. When compiled as C, sokol_imgui.h will call
  16. cimgui.h functions instead.
  17. NOTE that the formerly separate header sokol_cimgui.h has been
  18. merged into sokol_imgui.h
  19. The following defines are used by the implementation to select the
  20. platform-specific embedded shader code (these are the same defines as
  21. used by sokol_gfx.h and sokol_app.h):
  22. SOKOL_GLCORE33
  23. SOKOL_GLES3
  24. SOKOL_D3D11
  25. SOKOL_METAL
  26. SOKOL_WGPU
  27. Optionally provide the following configuration define both before including the
  28. the declaration and implementation:
  29. SOKOL_IMGUI_NO_SOKOL_APP - don't depend on sokol_app.h (see below for details)
  30. Optionally provide the following macros before including the implementation
  31. to override defaults:
  32. SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
  33. SOKOL_IMGUI_API_DECL- public function declaration prefix (default: extern)
  34. SOKOL_API_DECL - same as SOKOL_IMGUI_API_DECL
  35. SOKOL_API_IMPL - public function implementation prefix (default: -)
  36. If sokol_imgui.h is compiled as a DLL, define the following before
  37. including the declaration or implementation:
  38. SOKOL_DLL
  39. On Windows, SOKOL_DLL will define SOKOL_IMGUI_API_DECL as __declspec(dllexport)
  40. or __declspec(dllimport) as needed.
  41. Include the following headers before sokol_imgui.h (both before including
  42. the declaration and implementation):
  43. sokol_gfx.h
  44. sokol_app.h (except SOKOL_IMGUI_NO_SOKOL_APP)
  45. Additionally, include the following headers before including the
  46. implementation:
  47. If the implementation is compiled as C++:
  48. imgui.h
  49. If the implementation is compiled as C:
  50. cimgui.h
  51. FEATURE OVERVIEW:
  52. =================
  53. sokol_imgui.h implements the initialization, rendering and event-handling
  54. code for Dear ImGui (https://github.com/ocornut/imgui) on top of
  55. sokol_gfx.h and (optionally) sokol_app.h.
  56. The sokol_app.h dependency is optional and used for input event handling.
  57. If you only use sokol_gfx.h but not sokol_app.h in your application,
  58. define SOKOL_IMGUI_NO_SOKOL_APP before including the implementation
  59. of sokol_imgui.h, this will remove any dependency to sokol_app.h, but
  60. you must feed input events into Dear ImGui yourself.
  61. sokol_imgui.h is not thread-safe, all calls must be made from the
  62. same thread where sokol_gfx.h is running.
  63. HOWTO:
  64. ======
  65. --- To initialize sokol-imgui, call:
  66. simgui_setup(const simgui_desc_t* desc)
  67. This will initialize Dear ImGui and create sokol-gfx resources
  68. (two buffers for vertices and indices, a font texture and a pipeline-
  69. state-object).
  70. Use the following simgui_desc_t members to configure behaviour:
  71. int max_vertices
  72. The maximum number of vertices used for UI rendering, default is 65536.
  73. sokol-imgui will use this to compute the size of the vertex-
  74. and index-buffers allocated via sokol_gfx.h
  75. int image_pool_size
  76. Number of simgui_image_t objects which can be alive at the same time.
  77. The default is 256.
  78. sg_pixel_format color_format
  79. The color pixel format of the render pass where the UI
  80. will be rendered. The default (0) matches sokoL_gfx.h's
  81. default pass.
  82. sg_pixel_format depth_format
  83. The depth-buffer pixel format of the render pass where
  84. the UI will be rendered. The default (0) matches
  85. sokol_gfx.h's default pass depth format.
  86. int sample_count
  87. The MSAA sample-count of the render pass where the UI
  88. will be rendered. The default (0) matches sokol_gfx.h's
  89. default pass sample count.
  90. const char* ini_filename
  91. Sets this path as ImGui::GetIO().IniFilename where ImGui will store
  92. and load UI persistency data. By default this is 0, so that Dear ImGui
  93. will not preserve state between sessions (and also won't do
  94. any filesystem calls). Also see the ImGui functions:
  95. - LoadIniSettingsFromMemory()
  96. - SaveIniSettingsFromMemory()
  97. These functions give you explicit control over loading and saving
  98. UI state while using your own filesystem wrapper functions (in this
  99. case keep simgui_desc.ini_filename zero)
  100. bool no_default_font
  101. Set this to true if you don't want to use ImGui's default
  102. font. In this case you need to initialize the font
  103. yourself after simgui_setup() is called.
  104. bool disable_paste_override
  105. If set to true, sokol_imgui.h will not 'emulate' a Dear Imgui
  106. clipboard paste action on SAPP_EVENTTYPE_CLIPBOARD_PASTED event.
  107. This is mainly a hack/workaround to allow external workarounds
  108. for making copy/paste work on the web platform. In general,
  109. copy/paste support isn't properly fleshed out in sokol_imgui.h yet.
  110. bool disable_set_mouse_cursor
  111. If true, sokol_imgui.h will not control the mouse cursor type
  112. by calling sapp_set_mouse_cursor().
  113. bool disable_windows_resize_from_edges
  114. If true, windows can only be resized from the bottom right corner.
  115. The default is false, meaning windows can be resized from edges.
  116. bool write_alpha_channel
  117. Set this to true if you want alpha values written to the
  118. framebuffer. By default this behavior is disabled to prevent
  119. undesired behavior on platforms like the web where the canvas is
  120. always alpha-blended with the background.
  121. simgui_allocator_t allocator
  122. Used to override memory allocation functions. See further below
  123. for details.
  124. simgui_logger_t logger
  125. A user-provided logging callback. Note that without logging
  126. callback, sokol-imgui will be completely silent!
  127. See the section about ERROR REPORTING AND LOGGING below
  128. for more details.
  129. --- At the start of a frame, call:
  130. simgui_new_frame(&(simgui_frame_desc_t){
  131. .width = ...,
  132. .height = ...,
  133. .delta_time = ...,
  134. .dpi_scale = ...
  135. });
  136. 'width' and 'height' are the dimensions of the rendering surface,
  137. passed to ImGui::GetIO().DisplaySize.
  138. 'delta_time' is the frame duration passed to ImGui::GetIO().DeltaTime.
  139. 'dpi_scale' is the current DPI scale factor, if this is left zero-initialized,
  140. 1.0f will be used instead. Typical values for dpi_scale are >= 1.0f.
  141. For example, if you're using sokol_app.h and render to the default framebuffer:
  142. simgui_new_frame(&(simgui_frame_desc_t){
  143. .width = sapp_width(),
  144. .height = sapp_height(),
  145. .delta_time = sapp_frame_duration(),
  146. .dpi_scale = sapp_dpi_scale()
  147. });
  148. --- at the end of the frame, before the sg_end_pass() where you
  149. want to render the UI, call:
  150. simgui_render()
  151. This will first call ImGui::Render(), and then render ImGui's draw list
  152. through sokol_gfx.h
  153. --- if you're using sokol_app.h, from inside the sokol_app.h event callback,
  154. call:
  155. bool simgui_handle_event(const sapp_event* ev);
  156. The return value is the value of ImGui::GetIO().WantCaptureKeyboard,
  157. if this is true, you might want to skip keyboard input handling
  158. in your own event handler.
  159. If you want to use the ImGui functions for checking if a key is pressed
  160. (e.g. ImGui::IsKeyPressed()) the following helper function to map
  161. an sapp_keycode to an ImGuiKey value may be useful:
  162. int simgui_map_keycode(sapp_keycode c);
  163. Note that simgui_map_keycode() can be called outside simgui_setup()/simgui_shutdown().
  164. --- finally, on application shutdown, call
  165. simgui_shutdown()
  166. ON USER-PROVIDED IMAGES AND SAMPLERS
  167. ====================================
  168. To render your own images via ImGui::Image(), first create an simgui_image_t
  169. object from a sokol-gfx image and sampler object.
  170. // create a sokol-imgui image object which associates an sg_image with an sg_sampler
  171. simgui_image_t simgui_img = simgui_make_image(&(simgui_image_desc_t){
  172. .image = sg_make_image(...),
  173. .sampler = sg_make_sampler(...),
  174. });
  175. // convert the returned image handle into a ImTextureID handle
  176. ImTextureID tex_id = simgui_imtextureid(simgui_img);
  177. // use the ImTextureID handle in Dear ImGui calls:
  178. ImGui::Image(tex_id, ...);
  179. simgui_image_t objects are small and cheap (literally just the image and sampler
  180. handle).
  181. You can omit the sampler handle in the simgui_make_image() call, in this case a
  182. default sampler will be used with nearest-filtering and clamp-to-edge.
  183. Trying to render with an invalid simgui_image_t handle will render a small 8x8
  184. white default texture instead.
  185. To destroy a sokol-imgui image object, call
  186. simgui_destroy_image(simgui_img);
  187. But please be aware that the image object needs to be around until simgui_render() is called
  188. in a frame (if this turns out to be too much of a hassle we could introduce some sort
  189. of garbage collection where destroyed simgui_image_t objects are kept around until
  190. the simgui_render() call).
  191. You can call:
  192. simgui_image_desc_t desc = simgui_query_image_desc(img)
  193. ...to get the original desc struct, useful if you need to get the sokol-gfx image
  194. and sampler handle of the simgui_image_t object.
  195. You can convert an ImTextureID back into an simgui_image_t handle:
  196. simgui_image_t img = simgui_image_from_imtextureid(tex_id);
  197. MEMORY ALLOCATION OVERRIDE
  198. ==========================
  199. You can override the memory allocation functions at initialization time
  200. like this:
  201. void* my_alloc(size_t size, void* user_data) {
  202. return malloc(size);
  203. }
  204. void my_free(void* ptr, void* user_data) {
  205. free(ptr);
  206. }
  207. ...
  208. simgui_setup(&(simgui_desc_t){
  209. // ...
  210. .allocator = {
  211. .alloc_fn = my_alloc,
  212. .free_fn = my_free,
  213. .user_data = ...;
  214. }
  215. });
  216. ...
  217. If no overrides are provided, malloc and free will be used.
  218. This only affects memory allocation calls done by sokol_imgui.h
  219. itself though, not any allocations in Dear ImGui.
  220. ERROR REPORTING AND LOGGING
  221. ===========================
  222. To get any logging information at all you need to provide a logging callback in the setup call
  223. the easiest way is to use sokol_log.h:
  224. #include "sokol_log.h"
  225. simgui_setup(&(simgui_desc_t){
  226. .logger.func = slog_func
  227. });
  228. To override logging with your own callback, first write a logging function like this:
  229. void my_log(const char* tag, // e.g. 'simgui'
  230. uint32_t log_level, // 0=panic, 1=error, 2=warn, 3=info
  231. uint32_t log_item_id, // SIMGUI_LOGITEM_*
  232. const char* message_or_null, // a message string, may be nullptr in release mode
  233. uint32_t line_nr, // line number in sokol_imgui.h
  234. const char* filename_or_null, // source filename, may be nullptr in release mode
  235. void* user_data)
  236. {
  237. ...
  238. }
  239. ...and then setup sokol-imgui like this:
  240. simgui_setup(&(simgui_desc_t){
  241. .logger = {
  242. .func = my_log,
  243. .user_data = my_user_data,
  244. }
  245. });
  246. The provided logging function must be reentrant (e.g. be callable from
  247. different threads).
  248. If you don't want to provide your own custom logger it is highly recommended to use
  249. the standard logger in sokol_log.h instead, otherwise you won't see any warnings or
  250. errors.
  251. IMGUI EVENT HANDLING
  252. ====================
  253. You can call these functions from your platform's events to handle ImGui events
  254. when SOKOL_IMGUI_NO_SOKOL_APP is defined.
  255. E.g. mouse position events can be dispatched like this:
  256. simgui_add_mouse_pos_event(100, 200);
  257. Key events require a mapping function to convert your platform's key values to ImGuiKey's:
  258. int map_keycode(int keycode) {
  259. // Your mapping logic here...
  260. }
  261. simgui_add_key_event(map_keycode, keycode, true);
  262. Take note that modifiers (shift, ctrl, etc.) must be updated manually.
  263. If sokol_app is being used, ImGui events are handled for you.
  264. LICENSE
  265. =======
  266. zlib/libpng license
  267. Copyright (c) 2018 Andre Weissflog
  268. This software is provided 'as-is', without any express or implied warranty.
  269. In no event will the authors be held liable for any damages arising from the
  270. use of this software.
  271. Permission is granted to anyone to use this software for any purpose,
  272. including commercial applications, and to alter it and redistribute it
  273. freely, subject to the following restrictions:
  274. 1. The origin of this software must not be misrepresented; you must not
  275. claim that you wrote the original software. If you use this software in a
  276. product, an acknowledgment in the product documentation would be
  277. appreciated but is not required.
  278. 2. Altered source versions must be plainly marked as such, and must not
  279. be misrepresented as being the original software.
  280. 3. This notice may not be removed or altered from any source
  281. distribution.
  282. */
  283. #define SOKOL_IMGUI_INCLUDED (1)
  284. #include <stdint.h>
  285. #include <stdbool.h>
  286. #include <stddef.h> // size_t
  287. #if !defined(SOKOL_GFX_INCLUDED)
  288. #error "Please include sokol_gfx.h before sokol_imgui.h"
  289. #endif
  290. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) && !defined(SOKOL_APP_INCLUDED)
  291. #error "Please include sokol_app.h before sokol_imgui.h"
  292. #endif
  293. #if defined(SOKOL_API_DECL) && !defined(SOKOL_IMGUI_API_DECL)
  294. #define SOKOL_IMGUI_API_DECL SOKOL_API_DECL
  295. #endif
  296. #ifndef SOKOL_IMGUI_API_DECL
  297. #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMGUI_IMPL)
  298. #define SOKOL_IMGUI_API_DECL __declspec(dllexport)
  299. #elif defined(_WIN32) && defined(SOKOL_DLL)
  300. #define SOKOL_IMGUI_API_DECL __declspec(dllimport)
  301. #else
  302. #define SOKOL_IMGUI_API_DECL extern
  303. #endif
  304. #endif
  305. #ifdef __cplusplus
  306. extern "C" {
  307. #endif
  308. enum {
  309. SIMGUI_INVALID_ID = 0,
  310. };
  311. /*
  312. simgui_image_t
  313. A combined image-sampler pair used to inject custom images and samplers into Dear ImGui.
  314. Create with simgui_make_image(), and convert to an ImTextureID handle via
  315. simgui_imtextureid().
  316. */
  317. typedef struct simgui_image_t { uint32_t id; } simgui_image_t;
  318. /*
  319. simgui_image_desc_t
  320. Descriptor struct for simgui_make_image(). You must provide
  321. at least an sg_image handle. Keeping the sg_sampler handle
  322. zero-initialized will select the builtin default sampler
  323. which uses linear filtering.
  324. */
  325. typedef struct simgui_image_desc_t {
  326. sg_image image;
  327. sg_sampler sampler;
  328. } simgui_image_desc_t;
  329. /*
  330. simgui_log_item
  331. An enum with a unique item for each log message, warning, error
  332. and validation layer message.
  333. */
  334. #define _SIMGUI_LOG_ITEMS \
  335. _SIMGUI_LOGITEM_XMACRO(OK, "Ok") \
  336. _SIMGUI_LOGITEM_XMACRO(MALLOC_FAILED, "memory allocation failed") \
  337. _SIMGUI_LOGITEM_XMACRO(IMAGE_POOL_EXHAUSTED, "image pool exhausted") \
  338. #define _SIMGUI_LOGITEM_XMACRO(item,msg) SIMGUI_LOGITEM_##item,
  339. typedef enum simgui_log_item_t {
  340. _SIMGUI_LOG_ITEMS
  341. } simgui_log_item_t;
  342. #undef _SIMGUI_LOGITEM_XMACRO
  343. /*
  344. simgui_allocator_t
  345. Used in simgui_desc_t to provide custom memory-alloc and -free functions
  346. to sokol_imgui.h. If memory management should be overridden, both the
  347. alloc_fn and free_fn function must be provided (e.g. it's not valid to
  348. override one function but not the other).
  349. */
  350. typedef struct simgui_allocator_t {
  351. void* (*alloc_fn)(size_t size, void* user_data);
  352. void (*free_fn)(void* ptr, void* user_data);
  353. void* user_data;
  354. } simgui_allocator_t;
  355. /*
  356. simgui_logger
  357. Used in simgui_desc_t to provide a logging function. Please be aware
  358. that without logging function, sokol-imgui will be completely
  359. silent, e.g. it will not report errors, warnings and
  360. validation layer messages. For maximum error verbosity,
  361. compile in debug mode (e.g. NDEBUG *not* defined) and install
  362. a logger (for instance the standard logging function from sokol_log.h).
  363. */
  364. typedef struct simgui_logger_t {
  365. void (*func)(
  366. const char* tag, // always "simgui"
  367. uint32_t log_level, // 0=panic, 1=error, 2=warning, 3=info
  368. uint32_t log_item_id, // SIMGUI_LOGITEM_*
  369. const char* message_or_null, // a message string, may be nullptr in release mode
  370. uint32_t line_nr, // line number in sokol_imgui.h
  371. const char* filename_or_null, // source filename, may be nullptr in release mode
  372. void* user_data);
  373. void* user_data;
  374. } simgui_logger_t;
  375. typedef struct simgui_desc_t {
  376. int max_vertices; // default: 65536
  377. int image_pool_size; // default: 256
  378. sg_pixel_format color_format;
  379. sg_pixel_format depth_format;
  380. int sample_count;
  381. const char* ini_filename;
  382. bool no_default_font;
  383. bool disable_paste_override; // if true, don't send Ctrl-V on EVENTTYPE_CLIPBOARD_PASTED
  384. bool disable_set_mouse_cursor; // if true, don't control the mouse cursor type via sapp_set_mouse_cursor()
  385. bool disable_windows_resize_from_edges; // if true, only resize edges from the bottom right corner
  386. bool write_alpha_channel; // if true, alpha values get written into the framebuffer
  387. simgui_allocator_t allocator; // optional memory allocation overrides (default: malloc/free)
  388. simgui_logger_t logger; // optional log function override
  389. } simgui_desc_t;
  390. typedef struct simgui_frame_desc_t {
  391. int width;
  392. int height;
  393. double delta_time;
  394. float dpi_scale;
  395. } simgui_frame_desc_t;
  396. typedef struct simgui_font_tex_desc_t {
  397. sg_filter min_filter;
  398. sg_filter mag_filter;
  399. } simgui_font_tex_desc_t;
  400. SOKOL_IMGUI_API_DECL void simgui_setup(const simgui_desc_t* desc);
  401. SOKOL_IMGUI_API_DECL void simgui_new_frame(const simgui_frame_desc_t* desc);
  402. SOKOL_IMGUI_API_DECL void simgui_render(void);
  403. SOKOL_IMGUI_API_DECL simgui_image_t simgui_make_image(const simgui_image_desc_t* desc);
  404. SOKOL_IMGUI_API_DECL void simgui_destroy_image(simgui_image_t img);
  405. SOKOL_IMGUI_API_DECL simgui_image_desc_t simgui_query_image_desc(simgui_image_t img);
  406. SOKOL_IMGUI_API_DECL void* simgui_imtextureid(simgui_image_t img);
  407. SOKOL_IMGUI_API_DECL simgui_image_t simgui_image_from_imtextureid(void* imtextureid);
  408. SOKOL_IMGUI_API_DECL void simgui_add_focus_event(bool focus);
  409. SOKOL_IMGUI_API_DECL void simgui_add_mouse_pos_event(float x, float y);
  410. SOKOL_IMGUI_API_DECL void simgui_add_touch_pos_event(float x, float y);
  411. SOKOL_IMGUI_API_DECL void simgui_add_mouse_button_event(int mouse_button, bool down);
  412. SOKOL_IMGUI_API_DECL void simgui_add_mouse_wheel_event(float wheel_x, float wheel_y);
  413. SOKOL_IMGUI_API_DECL void simgui_add_key_event(int (*map_keycode)(int), int keycode, bool down);
  414. SOKOL_IMGUI_API_DECL void simgui_add_input_character(uint32_t c);
  415. SOKOL_IMGUI_API_DECL void simgui_add_input_characters_utf8(const char* c);
  416. SOKOL_IMGUI_API_DECL void simgui_add_touch_button_event(int mouse_button, bool down);
  417. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  418. SOKOL_IMGUI_API_DECL bool simgui_handle_event(const sapp_event* ev);
  419. SOKOL_IMGUI_API_DECL int simgui_map_keycode(sapp_keycode keycode); // returns ImGuiKey_*
  420. #endif
  421. SOKOL_IMGUI_API_DECL void simgui_shutdown(void);
  422. SOKOL_IMGUI_API_DECL void simgui_create_fonts_texture(const simgui_font_tex_desc_t* desc);
  423. SOKOL_IMGUI_API_DECL void simgui_destroy_fonts_texture(void);
  424. #ifdef __cplusplus
  425. } // extern "C"
  426. // reference-based equivalents for C++
  427. inline void simgui_setup(const simgui_desc_t& desc) { return simgui_setup(&desc); }
  428. inline simgui_image_t simgui_make_image(const simgui_image_desc_t& desc) { return simgui_make_image(&desc); }
  429. inline void simgui_new_frame(const simgui_frame_desc_t& desc) { return simgui_new_frame(&desc); }
  430. inline void simgui_create_fonts_texture(const simgui_font_tex_desc_t& desc) { return simgui_create_fonts_texture(&desc); }
  431. #endif
  432. #endif /* SOKOL_IMGUI_INCLUDED */
  433. //-- IMPLEMENTATION ------------------------------------------------------------
  434. #ifdef SOKOL_IMGUI_IMPL
  435. #define SOKOL_IMGUI_IMPL_INCLUDED (1)
  436. #if defined(SOKOL_MALLOC) || defined(SOKOL_CALLOC) || defined(SOKOL_FREE)
  437. #error "SOKOL_MALLOC/CALLOC/FREE macros are no longer supported, please use simgui_desc_t.allocator to override memory allocation functions"
  438. #endif
  439. #if defined(__cplusplus)
  440. #if !defined(IMGUI_VERSION)
  441. #error "Please include imgui.h before the sokol_imgui.h implementation"
  442. #endif
  443. #else
  444. #if !defined(CIMGUI_INCLUDED)
  445. #error "Please include cimgui.h before the sokol_imgui.h implementation"
  446. #endif
  447. #endif
  448. #include <string.h> // memset
  449. #include <stdlib.h> // malloc/free
  450. #if defined(__EMSCRIPTEN__) && !defined(SOKOL_DUMMY_BACKEND)
  451. #include <emscripten.h>
  452. #endif
  453. #ifndef SOKOL_API_IMPL
  454. #define SOKOL_API_IMPL
  455. #endif
  456. #ifndef SOKOL_DEBUG
  457. #ifndef NDEBUG
  458. #define SOKOL_DEBUG
  459. #endif
  460. #endif
  461. #ifndef SOKOL_ASSERT
  462. #include <assert.h>
  463. #define SOKOL_ASSERT(c) assert(c)
  464. #endif
  465. #ifndef _SOKOL_PRIVATE
  466. #if defined(__GNUC__) || defined(__clang__)
  467. #define _SOKOL_PRIVATE __attribute__((unused)) static
  468. #else
  469. #define _SOKOL_PRIVATE static
  470. #endif
  471. #endif
  472. #define _SIMGUI_INIT_COOKIE (0xBABEBABE)
  473. #define _SIMGUI_INVALID_SLOT_INDEX (0)
  474. #define _SIMGUI_SLOT_SHIFT (16)
  475. #define _SIMGUI_MAX_POOL_SIZE (1<<_SIMGUI_SLOT_SHIFT)
  476. #define _SIMGUI_SLOT_MASK (_SIMGUI_MAX_POOL_SIZE-1)
  477. // helper macros and constants
  478. #define _simgui_def(val, def) (((val) == 0) ? (def) : (val))
  479. // workaround for missing ImDrawCallback_ResetRenderState in cimgui.h
  480. // see: https://github.com/cimgui/cimgui/issues/261
  481. #ifndef ImDrawCallback_ResetRenderState
  482. #define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8)
  483. #endif
  484. typedef struct {
  485. ImVec2 disp_size;
  486. uint8_t _pad_8[8];
  487. } _simgui_vs_params_t;
  488. typedef enum {
  489. _SIMGUI_RESOURCESTATE_INITIAL,
  490. _SIMGUI_RESOURCESTATE_ALLOC,
  491. _SIMGUI_RESOURCESTATE_VALID,
  492. _SIMGUI_RESOURCESTATE_FAILED,
  493. _SIMGUI_RESOURCESTATE_INVALID,
  494. _SIMGUI_RESOURCESTATE_FORCE_U32 = 0x7FFFFFFF
  495. } _simgui_resource_state;
  496. typedef struct {
  497. uint32_t id;
  498. _simgui_resource_state state;
  499. } _simgui_slot_t;
  500. typedef struct {
  501. int size;
  502. int queue_top;
  503. uint32_t* gen_ctrs;
  504. int* free_queue;
  505. } _simgui_pool_t;
  506. typedef struct {
  507. _simgui_slot_t slot;
  508. sg_image image;
  509. sg_sampler sampler;
  510. sg_pipeline pip; // this will either be _simgui.def_pip or _simgui.pip_unfilterable
  511. } _simgui_image_t;
  512. typedef struct {
  513. _simgui_pool_t pool;
  514. _simgui_image_t* items;
  515. } _simgui_image_pool_t;
  516. typedef struct {
  517. uint32_t init_cookie;
  518. simgui_desc_t desc;
  519. float cur_dpi_scale;
  520. sg_buffer vbuf;
  521. sg_buffer ibuf;
  522. sg_image font_img;
  523. sg_sampler font_smp;
  524. simgui_image_t default_font;
  525. sg_image def_img; // used as default image for user images
  526. sg_sampler def_smp; // used as default sampler for user images
  527. sg_shader def_shd;
  528. sg_pipeline def_pip;
  529. // separate shader and pipeline for unfilterable user images
  530. sg_shader shd_unfilterable;
  531. sg_pipeline pip_unfilterable;
  532. sg_range vertices;
  533. sg_range indices;
  534. bool is_osx;
  535. _simgui_image_pool_t image_pool;
  536. } _simgui_state_t;
  537. static _simgui_state_t _simgui;
  538. /*
  539. Embedded source code compiled with:
  540. sokol-shdc -i simgui.glsl -o simgui.h -l glsl330:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgpu -b
  541. (not that for Metal and D3D11 byte code, sokol-shdc must be run
  542. on macOS and Windows)
  543. @vs vs
  544. uniform vs_params {
  545. vec2 disp_size;
  546. };
  547. in vec2 position;
  548. in vec2 texcoord0;
  549. in vec4 color0;
  550. out vec2 uv;
  551. out vec4 color;
  552. void main() {
  553. gl_Position = vec4(((position/disp_size)-0.5)*vec2(2.0,-2.0), 0.5, 1.0);
  554. uv = texcoord0;
  555. color = color0;
  556. }
  557. @end
  558. @fs fs
  559. uniform texture2D tex;
  560. uniform sampler smp;
  561. in vec2 uv;
  562. in vec4 color;
  563. out vec4 frag_color;
  564. void main() {
  565. frag_color = texture(sampler2D(tex, smp), uv) * color;
  566. }
  567. @end
  568. @program simgui vs fs
  569. */
  570. #if defined(SOKOL_GLCORE33)
  571. static const char _simgui_vs_source_glsl330[341] = {
  572. 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
  573. 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
  574. 0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
  575. 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
  576. 0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
  577. 0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,
  578. 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,
  579. 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,
  580. 0x72,0x64,0x30,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,
  581. 0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
  582. 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
  583. 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
  584. 0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,
  585. 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,
  586. 0x28,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2f,0x20,0x76,0x73,0x5f,
  587. 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,0x20,0x2d,0x20,
  588. 0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,
  589. 0x32,0x28,0x32,0x2e,0x30,0x2c,0x20,0x2d,0x32,0x2e,0x30,0x29,0x2c,0x20,0x30,0x2e,
  590. 0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,
  591. 0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,
  592. 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,
  593. 0x0a,0x7d,0x0a,0x0a,0x00,
  594. };
  595. static const char _simgui_fs_source_glsl330[177] = {
  596. 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
  597. 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,
  598. 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
  599. 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,
  600. 0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
  601. 0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,
  602. 0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,
  603. 0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,
  604. 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,
  605. 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,
  606. 0x75,0x76,0x29,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,
  607. 0x00,
  608. };
  609. #elif defined(SOKOL_GLES3)
  610. static const char _simgui_vs_source_glsl300es[344] = {
  611. 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
  612. 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
  613. 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
  614. 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
  615. 0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
  616. 0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,
  617. 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
  618. 0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,
  619. 0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,
  620. 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
  621. 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,
  622. 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f,
  623. 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
  624. 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,
  625. 0x63,0x34,0x28,0x28,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2f,0x20,
  626. 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,
  627. 0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,
  628. 0x76,0x65,0x63,0x32,0x28,0x32,0x2e,0x30,0x2c,0x20,0x2d,0x32,0x2e,0x30,0x29,0x2c,
  629. 0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
  630. 0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,
  631. 0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,
  632. 0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
  633. };
  634. static const char _simgui_fs_source_glsl300es[250] = {
  635. 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
  636. 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
  637. 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
  638. 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,
  639. 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,
  640. 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,
  641. 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
  642. 0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
  643. 0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
  644. 0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x75,
  645. 0x76,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,
  646. 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
  647. 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,
  648. 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,
  649. 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x20,0x2a,0x20,0x63,
  650. 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
  651. };
  652. #elif defined(SOKOL_METAL)
  653. static const uint8_t _simgui_vs_bytecode_metal_macos[3052] = {
  654. 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  655. 0xec,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  656. 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  657. 0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  658. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  659. 0xe0,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,
  660. 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
  661. 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0x7b,0x12,0x23,0x17,0xd9,0x25,0x1c,
  662. 0x1b,0x42,0x42,0x9f,0xbf,0x31,0xd2,0x2c,0x3a,0x55,0x22,0x1d,0x40,0xd8,0xc4,0xf8,
  663. 0x20,0x49,0x60,0x6d,0x3c,0xea,0x4e,0x1c,0x34,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,
  664. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  665. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08,
  666. 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x37,0x00,0x00,0x00,0x56,0x41,0x54,
  667. 0x54,0x22,0x00,0x03,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80,
  668. 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f,
  669. 0x72,0x30,0x00,0x02,0x80,0x56,0x41,0x54,0x59,0x05,0x00,0x03,0x00,0x04,0x04,0x06,
  670. 0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,
  671. 0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0xc8,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,
  672. 0x42,0x43,0xc0,0xde,0x21,0x0c,0x00,0x00,0xaf,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,
  673. 0x02,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,
  674. 0x06,0x10,0x32,0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,
  675. 0x80,0x10,0x45,0x02,0x42,0x92,0x0b,0x42,0x84,0x10,0x32,0x14,0x38,0x08,0x18,0x49,
  676. 0x0a,0x32,0x44,0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,
  677. 0x24,0x07,0xc8,0x08,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,
  678. 0x51,0x18,0x00,0x00,0x81,0x00,0x00,0x00,0x1b,0xc8,0x25,0xf8,0xff,0xff,0xff,0xff,
  679. 0x01,0x90,0x80,0x8a,0x18,0x87,0x77,0x90,0x07,0x79,0x28,0x87,0x71,0xa0,0x07,0x76,
  680. 0xc8,0x87,0x36,0x90,0x87,0x77,0xa8,0x07,0x77,0x20,0x87,0x72,0x20,0x87,0x36,0x20,
  681. 0x87,0x74,0xb0,0x87,0x74,0x20,0x87,0x72,0x68,0x83,0x79,0x88,0x07,0x79,0xa0,0x87,
  682. 0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0xc0,0x1c,0xc2,0x81,
  683. 0x1d,0xe6,0xa1,0x1c,0x00,0x82,0x1c,0xd2,0x61,0x1e,0xc2,0x41,0x1c,0xd8,0xa1,0x1c,
  684. 0xda,0x80,0x1e,0xc2,0x21,0x1d,0xd8,0xa1,0x0d,0xc6,0x21,0x1c,0xd8,0x81,0x1d,0xe6,
  685. 0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07,0x80,0x60,0x87,0x72,0x98,0x87,0x79,
  686. 0x68,0x03,0x78,0x90,0x87,0x72,0x18,0x87,0x74,0x98,0x87,0x72,0x68,0x03,0x73,0x80,
  687. 0x87,0x76,0x08,0x07,0x72,0x00,0xcc,0x21,0x1c,0xd8,0x61,0x1e,0xca,0x01,0x20,0xdc,
  688. 0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21,0x1c,0xda,0xa1,0x1c,0xda,0x00,0x1e,0xde,0x21,
  689. 0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e,0xda,0xa0,0x1c,0xd8,0x21,0x1d,0xda,0x01,0xa0,
  690. 0x07,0x79,0xa8,0x87,0x72,0x00,0x06,0x77,0x78,0x87,0x36,0x30,0x07,0x79,0x08,0x87,
  691. 0x76,0x28,0x87,0x36,0x80,0x87,0x77,0x48,0x07,0x77,0xa0,0x87,0x72,0x90,0x87,0x36,
  692. 0x28,0x07,0x76,0x48,0x87,0x76,0x68,0x03,0x77,0x78,0x07,0x77,0x68,0x03,0x76,0x28,
  693. 0x87,0x70,0x30,0x07,0x80,0x70,0x87,0x77,0x68,0x83,0x74,0x70,0x07,0x73,0x98,0x87,
  694. 0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,
  695. 0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0x40,0x1d,0xea,0xa1,0x1d,0xe0,0xa1,0x0d,
  696. 0xe8,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,
  697. 0x72,0x00,0x08,0x77,0x78,0x87,0x36,0x70,0x87,0x70,0x70,0x87,0x79,0x68,0x03,0x73,
  698. 0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,
  699. 0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xe6,0x21,0x1d,0xce,0xc1,0x1d,0xca,0x81,0x1c,0xda,
  700. 0x40,0x1f,0xca,0x41,0x1e,0xde,0x61,0x1e,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,
  701. 0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,
  702. 0x03,0x7a,0x90,0x87,0x70,0x80,0x07,0x78,0x48,0x07,0x77,0x38,0x87,0x36,0x68,0x87,
  703. 0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0x62,0x1e,0xe8,0x21,
  704. 0x1c,0xc6,0x61,0x1d,0xda,0x00,0x1e,0xe4,0xe1,0x1d,0xe8,0xa1,0x1c,0xc6,0x81,0x1e,
  705. 0xde,0x41,0x1e,0xda,0x40,0x1c,0xea,0xc1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x0d,0xe6,
  706. 0x21,0x1d,0xf4,0xa1,0x1c,0x00,0x3c,0x00,0x88,0x7a,0x70,0x87,0x79,0x08,0x07,0x73,
  707. 0x28,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,
  708. 0xe4,0xa1,0x1e,0xca,0x01,0x20,0xea,0x61,0x1e,0xca,0xa1,0x0d,0xe6,0xe1,0x1d,0xcc,
  709. 0x81,0x1e,0xda,0xc0,0x1c,0xd8,0xe1,0x1d,0xc2,0x81,0x1e,0x00,0x73,0x08,0x07,0x76,
  710. 0x98,0x87,0x72,0x00,0x36,0x18,0x02,0x01,0x2c,0x40,0x05,0x00,0x49,0x18,0x00,0x00,
  711. 0x01,0x00,0x00,0x00,0x13,0x84,0x40,0x00,0x89,0x20,0x00,0x00,0x16,0x00,0x00,0x00,
  712. 0x32,0x22,0x08,0x09,0x20,0x64,0x85,0x04,0x13,0x22,0xa4,0x84,0x04,0x13,0x22,0xe3,
  713. 0x84,0xa1,0x90,0x14,0x12,0x4c,0x88,0x8c,0x0b,0x84,0x84,0x4c,0x10,0x3c,0x33,0x00,
  714. 0xc3,0x08,0x02,0x30,0x8c,0x40,0x00,0x76,0x08,0x91,0x83,0xa4,0x29,0xa2,0x84,0xc9,
  715. 0xaf,0xa4,0xff,0x01,0x22,0x80,0x91,0x50,0x10,0x83,0x08,0x84,0x50,0x8a,0x89,0x90,
  716. 0x22,0x1b,0x08,0x98,0x23,0x00,0x83,0x14,0xc8,0x39,0x02,0x50,0x18,0x44,0x08,0x84,
  717. 0x61,0x04,0x22,0x19,0x01,0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0,0x03,
  718. 0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87,0x71,
  719. 0x78,0x87,0x79,0xc0,0x87,0x38,0x80,0x03,0x37,0x88,0x83,0x38,0x70,0x03,0x38,0xd8,
  720. 0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,
  721. 0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,
  722. 0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,0x7a,
  723. 0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,0x30,
  724. 0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,
  725. 0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,
  726. 0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,
  727. 0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,
  728. 0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,
  729. 0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,
  730. 0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,
  731. 0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,
  732. 0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,
  733. 0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,
  734. 0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,0x75,
  735. 0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,0xa0,
  736. 0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,0x07,
  737. 0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x6d,
  738. 0x60,0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,0xa0,
  739. 0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,0x07,
  740. 0x7a,0x30,0x07,0x72,0x30,0x84,0x39,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xc8,
  741. 0x02,0x01,0x00,0x00,0x09,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,
  742. 0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0xca,0x12,0x18,0x01,0x28,0x88,0x22,0x28,0x84,
  743. 0x32,0xa0,0x1d,0x01,0x20,0x1d,0x4b,0x68,0x02,0x00,0x00,0x00,0x79,0x18,0x00,0x00,
  744. 0xea,0x00,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,
  745. 0xb9,0xb4,0x37,0xb7,0x21,0x46,0x42,0x20,0x80,0x82,0x50,0xb9,0x1b,0x43,0x0b,0x93,
  746. 0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x24,0x01,0x22,0x24,0x05,0xe7,0x20,0x08,0x0e,
  747. 0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,
  748. 0x0d,0x64,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,0x2e,
  749. 0x8c,0xcd,0xac,0xac,0x65,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,0x26,
  750. 0x65,0x88,0x80,0x10,0x43,0x8c,0x24,0x48,0x86,0x44,0x60,0xd1,0x54,0x46,0x17,0xc6,
  751. 0x36,0x04,0x41,0x8e,0x24,0x48,0x82,0x44,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,0xd6,
  752. 0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,0x36,
  753. 0x17,0x26,0xc6,0x56,0x36,0x44,0x40,0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,
  754. 0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,
  755. 0x6e,0x61,0x62,0x6c,0x65,0x43,0x04,0x64,0x61,0x19,0x84,0xa5,0xc9,0xb9,0x8c,0xbd,
  756. 0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,0x95,
  757. 0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x91,0xa5,0xcd,0x85,0x89,0xb1,0x95,0x0d,
  758. 0x11,0x90,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0xd7,0x5b,
  759. 0x1d,0x1d,0x5c,0x1d,0x1d,0x97,0xba,0xb9,0x32,0x39,0x14,0xb6,0xb7,0x31,0x37,0x98,
  760. 0x14,0x46,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,0x65,0x5f,0x6e,
  761. 0x61,0x6d,0x65,0x34,0xcc,0xd8,0xde,0xc2,0xe8,0x64,0xc8,0x84,0xa5,0xc9,0xb9,0x84,
  762. 0xc9,0x9d,0x7d,0xb9,0x85,0xb5,0x95,0x51,0xa8,0xb3,0x1b,0xc2,0x20,0x0f,0x02,0x21,
  763. 0x11,0x22,0x21,0x13,0x42,0x71,0xa9,0x9b,0x2b,0x93,0x43,0x61,0x7b,0x1b,0x73,0x8b,
  764. 0x49,0xa1,0x61,0xc6,0xf6,0x16,0x46,0x47,0xc3,0x62,0xec,0x8d,0xed,0x4d,0x6e,0x08,
  765. 0x83,0x3c,0x88,0x85,0x44,0xc8,0x85,0x4c,0x08,0x46,0x26,0x2c,0x4d,0xce,0x05,0xee,
  766. 0x6d,0x2e,0x8d,0x2e,0xed,0xcd,0x8d,0xcb,0x19,0xdb,0x17,0xd4,0xdb,0x5c,0x1a,0x5d,
  767. 0xda,0x9b,0xdb,0x10,0x05,0xd1,0x90,0x08,0xb9,0x90,0x09,0xd9,0x86,0x18,0x48,0x85,
  768. 0x64,0x08,0x47,0x28,0x2c,0x4d,0xce,0xc5,0xae,0x4c,0x8e,0xae,0x0c,0xef,0x2b,0xcd,
  769. 0x0d,0xae,0x8e,0x8e,0x52,0x58,0x9a,0x9c,0x0b,0xdb,0xdb,0x58,0x18,0x5d,0xda,0x9b,
  770. 0xdb,0x57,0x9a,0x1b,0x59,0x19,0x1e,0xbd,0xb3,0x32,0xb7,0x32,0xb9,0x30,0xba,0x32,
  771. 0x32,0x94,0xaf,0xaf,0xb0,0x34,0xb9,0x2f,0x38,0xb6,0xb0,0xb1,0x32,0xb4,0x37,0x36,
  772. 0xb2,0x32,0xb9,0xaf,0xaf,0x14,0x22,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x43,
  773. 0xa8,0x44,0x40,0x3c,0xe4,0x4b,0x84,0x24,0x40,0xc0,0x00,0x89,0x10,0x09,0x99,0x90,
  774. 0x30,0x60,0x42,0x57,0x86,0x37,0xf6,0xf6,0x26,0x47,0x06,0x33,0x84,0x4a,0x02,0xc4,
  775. 0x43,0xbe,0x24,0x48,0x02,0x04,0x0c,0x90,0x08,0x91,0x90,0x09,0x19,0x03,0x1a,0x63,
  776. 0x6f,0x6c,0x6f,0x72,0x30,0x43,0xa8,0x84,0x40,0x3c,0xe4,0x4b,0x88,0x24,0x40,0xc0,
  777. 0x00,0x89,0x90,0x0b,0x99,0x90,0x32,0xa0,0x12,0x96,0x26,0xe7,0x22,0x56,0x67,0x66,
  778. 0x56,0x26,0xc7,0x27,0x2c,0x4d,0xce,0x45,0xac,0xce,0xcc,0xac,0x4c,0xee,0x6b,0x2e,
  779. 0x4d,0xaf,0x8c,0x48,0x58,0x9a,0x9c,0x8b,0x5c,0x59,0x18,0x19,0xa9,0xb0,0x34,0x39,
  780. 0x97,0x39,0x3a,0xb9,0xba,0x31,0xba,0x2f,0xba,0x3c,0xb8,0xb2,0xaf,0x34,0x37,0xb3,
  781. 0x37,0x26,0x64,0x69,0x73,0x70,0x5f,0x73,0x69,0x7a,0x65,0x43,0x94,0x44,0x48,0x86,
  782. 0x44,0x40,0x24,0x64,0x0d,0x18,0x85,0xa5,0xc9,0xb9,0x84,0xc9,0x9d,0x7d,0xd1,0xe5,
  783. 0xc1,0x95,0x7d,0xcd,0xa5,0xe9,0x95,0xf1,0x0a,0x4b,0x93,0x73,0x09,0x93,0x3b,0xfb,
  784. 0xa2,0xcb,0x83,0x2b,0xfb,0x0a,0x63,0x4b,0x3b,0x73,0xfb,0x9a,0x4b,0xd3,0x2b,0x63,
  785. 0x62,0x37,0xf7,0x05,0x17,0x26,0x17,0xd6,0x36,0xc7,0xe1,0x4b,0x46,0x66,0x08,0x19,
  786. 0x24,0x06,0x72,0x06,0x08,0x1a,0x24,0x03,0xf2,0x25,0x42,0x12,0x20,0x69,0x80,0xa8,
  787. 0x01,0xc2,0x06,0x48,0x1b,0x24,0x03,0xe2,0x06,0xc9,0x80,0x44,0xc8,0x1b,0x20,0x13,
  788. 0x02,0x07,0x43,0x10,0x44,0x0c,0x10,0x32,0x40,0xcc,0x00,0x89,0x83,0x21,0xc6,0x01,
  789. 0x20,0x1d,0x22,0x07,0x7c,0xde,0xda,0xdc,0xd2,0xe0,0xde,0xe8,0xca,0xdc,0xe8,0x40,
  790. 0xc6,0xd0,0xc2,0xe4,0xf8,0x4c,0xa5,0xb5,0xc1,0xb1,0x95,0x81,0x0c,0xad,0xac,0x80,
  791. 0x50,0x09,0x05,0x05,0x0d,0x11,0x90,0x3a,0x18,0x62,0x20,0x74,0x80,0xd8,0xc1,0x72,
  792. 0x0c,0x31,0x90,0x3b,0x40,0xee,0x60,0x39,0x46,0x44,0xec,0xc0,0x0e,0xf6,0xd0,0x0e,
  793. 0x6e,0xd0,0x0e,0xef,0x40,0x0e,0xf5,0xc0,0x0e,0xe5,0xe0,0x06,0xe6,0xc0,0x0e,0xe1,
  794. 0x70,0x0e,0xf3,0x30,0x45,0x08,0x86,0x11,0x0a,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,
  795. 0xa4,0x03,0x39,0x94,0x83,0x3b,0xd0,0xc3,0x94,0xa0,0x18,0xb1,0x84,0x43,0x3a,0xc8,
  796. 0x83,0x1b,0xd8,0x43,0x39,0xc8,0xc3,0x3c,0xa4,0xc3,0x3b,0xb8,0xc3,0x94,0xc0,0x18,
  797. 0x41,0x85,0x43,0x3a,0xc8,0x83,0x1b,0xb0,0x43,0x38,0xb8,0xc3,0x39,0xd4,0x43,0x38,
  798. 0x9c,0x43,0x39,0xfc,0x82,0x3d,0x94,0x83,0x3c,0xcc,0x43,0x3a,0xbc,0x83,0x3b,0x4c,
  799. 0x09,0x90,0x11,0x53,0x38,0xa4,0x83,0x3c,0xb8,0xc1,0x38,0xbc,0x43,0x3b,0xc0,0x43,
  800. 0x3a,0xb0,0x43,0x39,0xfc,0xc2,0x3b,0xc0,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x3c,
  801. 0x4c,0x19,0x14,0xc6,0x19,0xa1,0x84,0x43,0x3a,0xc8,0x83,0x1b,0xd8,0x43,0x39,0xc8,
  802. 0x03,0x3d,0x94,0x03,0x3e,0x4c,0x09,0xe6,0x00,0x00,0x00,0x00,0x79,0x18,0x00,0x00,
  803. 0x7b,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,
  804. 0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,
  805. 0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,
  806. 0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,
  807. 0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,
  808. 0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,
  809. 0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,
  810. 0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,
  811. 0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,
  812. 0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,
  813. 0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,
  814. 0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,
  815. 0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,
  816. 0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,
  817. 0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,
  818. 0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,
  819. 0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,
  820. 0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,
  821. 0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,
  822. 0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,
  823. 0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,
  824. 0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,
  825. 0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,
  826. 0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,
  827. 0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,
  828. 0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,
  829. 0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,
  830. 0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,
  831. 0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,
  832. 0x66,0x50,0x59,0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4,0x83,0x3b,0x8c,0x03,0x3d,
  833. 0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43,0x3d,0xc0,0xc3,0x3c,0x00,
  834. 0x71,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x06,0x50,0x30,0x00,0xd2,0xd0,0x00,0x00,
  835. 0x61,0x20,0x00,0x00,0x23,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,
  836. 0x11,0x00,0x00,0x00,0xd4,0x63,0x11,0x40,0x60,0x1c,0x73,0x10,0x42,0xf0,0x3c,0x94,
  837. 0x33,0x00,0x14,0x63,0x09,0x20,0x08,0x82,0xf0,0x2f,0x80,0x20,0x08,0xc2,0xbf,0x30,
  838. 0x96,0x00,0x82,0x20,0x08,0x82,0x01,0x08,0x82,0x20,0x08,0x0e,0x33,0x00,0x24,0x73,
  839. 0x10,0xd7,0x65,0x55,0x34,0x33,0x00,0x04,0x63,0x04,0x20,0x08,0x82,0xf8,0x37,0x46,
  840. 0x00,0x82,0x20,0x08,0x7f,0x33,0x00,0x00,0xe3,0x0d,0x4c,0x64,0x51,0x40,0x2c,0x0a,
  841. 0xe8,0x63,0xc1,0x02,0x1f,0x0b,0x16,0xf9,0x0c,0x32,0x04,0xcb,0x33,0xc8,0x10,0x2c,
  842. 0xd1,0x6c,0xc3,0x52,0x01,0xb3,0x0d,0x41,0x15,0xcc,0x36,0x04,0x83,0x90,0x41,0x40,
  843. 0x0c,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x5b,0x86,0x20,0xc0,0x03,0x00,0x00,0x00,
  844. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  845. };
  846. static const uint8_t _simgui_fs_bytecode_metal_macos[2809] = {
  847. 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  848. 0xf9,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  849. 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  850. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  851. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  852. 0x20,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,
  853. 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
  854. 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0xa1,0xce,0x6b,0xd1,0x1f,0x32,0x9e,
  855. 0x8d,0x8d,0x1c,0xcc,0x19,0xcb,0xd3,0xb6,0x21,0x99,0x0b,0xb6,0x46,0x8b,0x87,0x98,
  856. 0x8e,0x2d,0xb5,0x98,0x92,0x0a,0x81,0x7d,0xf3,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,
  857. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  858. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08,
  859. 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,
  860. 0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,
  861. 0x00,0x14,0x00,0x00,0x00,0x0c,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,
  862. 0xde,0x21,0x0c,0x00,0x00,0x80,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,
  863. 0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,
  864. 0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,
  865. 0x02,0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,
  866. 0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,
  867. 0x48,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,
  868. 0x00,0x89,0x00,0x00,0x00,0x1b,0xcc,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x60,0x00,
  869. 0x09,0xa8,0x88,0x71,0x78,0x07,0x79,0x90,0x87,0x72,0x18,0x07,0x7a,0x60,0x87,0x7c,
  870. 0x68,0x03,0x79,0x78,0x87,0x7a,0x70,0x07,0x72,0x28,0x07,0x72,0x68,0x03,0x72,0x48,
  871. 0x07,0x7b,0x48,0x07,0x72,0x28,0x87,0x36,0x98,0x87,0x78,0x90,0x07,0x7a,0x68,0x03,
  872. 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xcc,0x21,0x1c,0xd8,0x61,
  873. 0x1e,0xca,0x01,0x20,0xc8,0x21,0x1d,0xe6,0x21,0x1c,0xc4,0x81,0x1d,0xca,0xa1,0x0d,
  874. 0xe8,0x21,0x1c,0xd2,0x81,0x1d,0xda,0x60,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0x1e,0x00,
  875. 0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x76,0x28,0x87,0x79,0x98,0x87,0x36,
  876. 0x80,0x07,0x79,0x28,0x87,0x71,0x48,0x87,0x79,0x28,0x87,0x36,0x30,0x07,0x78,0x68,
  877. 0x87,0x70,0x20,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0xc2,0x1d,0xde,
  878. 0xa1,0x0d,0xcc,0x41,0x1e,0xc2,0xa1,0x1d,0xca,0xa1,0x0d,0xe0,0xe1,0x1d,0xd2,0xc1,
  879. 0x1d,0xe8,0xa1,0x1c,0xe4,0xa1,0x0d,0xca,0x81,0x1d,0xd2,0xa1,0x1d,0x00,0x7a,0x90,
  880. 0x87,0x7a,0x28,0x07,0x60,0x70,0x87,0x77,0x68,0x03,0x73,0x90,0x87,0x70,0x68,0x87,
  881. 0x72,0x68,0x03,0x78,0x78,0x87,0x74,0x70,0x07,0x7a,0x28,0x07,0x79,0x68,0x83,0x72,
  882. 0x60,0x87,0x74,0x68,0x87,0x36,0x70,0x87,0x77,0x70,0x87,0x36,0x60,0x87,0x72,0x08,
  883. 0x07,0x73,0x00,0x08,0x77,0x78,0x87,0x36,0x48,0x07,0x77,0x30,0x87,0x79,0x68,0x03,
  884. 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,
  885. 0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xd4,0xa1,0x1e,0xda,0x01,0x1e,0xda,0x80,0x1e,
  886. 0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07,
  887. 0x80,0x70,0x87,0x77,0x68,0x03,0x77,0x08,0x07,0x77,0x98,0x87,0x36,0x30,0x07,0x78,
  888. 0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,
  889. 0xdc,0xe1,0x1d,0xda,0x60,0x1e,0xd2,0xe1,0x1c,0xdc,0xa1,0x1c,0xc8,0xa1,0x0d,0xf4,
  890. 0xa1,0x1c,0xe4,0xe1,0x1d,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81,
  891. 0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0xa0,
  892. 0x07,0x79,0x08,0x07,0x78,0x80,0x87,0x74,0x70,0x87,0x73,0x68,0x83,0x76,0x08,0x07,
  893. 0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xe6,0x81,0x1e,0xc2,0x61,
  894. 0x1c,0xd6,0xa1,0x0d,0xe0,0x41,0x1e,0xde,0x81,0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d,
  895. 0xe4,0xa1,0x0d,0xc4,0xa1,0x1e,0xcc,0xc1,0x1c,0xca,0x41,0x1e,0xda,0x60,0x1e,0xd2,
  896. 0x41,0x1f,0xca,0x01,0xc0,0x03,0x80,0xa8,0x07,0x77,0x98,0x87,0x70,0x30,0x87,0x72,
  897. 0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,
  898. 0xea,0xa1,0x1c,0x00,0xa2,0x1e,0xe6,0xa1,0x1c,0xda,0x60,0x1e,0xde,0xc1,0x1c,0xe8,
  899. 0xa1,0x0d,0xcc,0x81,0x1d,0xde,0x21,0x1c,0xe8,0x01,0x30,0x87,0x70,0x60,0x87,0x79,
  900. 0x28,0x07,0x60,0x83,0x21,0x0c,0xc0,0x02,0x54,0x1b,0x8c,0x81,0x00,0x16,0xa0,0xda,
  901. 0x80,0x10,0xff,0xff,0xff,0xff,0x3f,0x00,0x0c,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80,
  902. 0x05,0xa8,0x36,0x18,0x86,0x00,0x2c,0x40,0x05,0x49,0x18,0x00,0x00,0x03,0x00,0x00,
  903. 0x00,0x13,0x86,0x40,0x18,0x26,0x0c,0x44,0x61,0x00,0x00,0x00,0x00,0x89,0x20,0x00,
  904. 0x00,0x1d,0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,
  905. 0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,
  906. 0x4c,0x10,0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x30,0x8c,0x20,0x00,0x47,0x49,
  907. 0x53,0x44,0x09,0x93,0xff,0x4f,0xc4,0x35,0x51,0x11,0xf1,0xdb,0xc3,0x3f,0x8d,0x11,
  908. 0x00,0x83,0x08,0x44,0x70,0x91,0x34,0x45,0x94,0x30,0xf9,0xbf,0x04,0x30,0xcf,0x42,
  909. 0x44,0xff,0x34,0x46,0x00,0x0c,0x22,0x18,0x42,0x29,0xc4,0x08,0xe5,0x10,0x9a,0x23,
  910. 0x08,0xe6,0x08,0xc0,0x60,0x18,0x41,0x58,0x0a,0x12,0xca,0x19,0x8a,0x29,0x40,0x6d,
  911. 0x20,0x20,0x05,0xd6,0x08,0x00,0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0,
  912. 0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87,
  913. 0x71,0x78,0x87,0x79,0xc0,0x87,0x38,0x80,0x03,0x37,0x88,0x83,0x38,0x70,0x03,0x38,
  914. 0xd8,0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
  915. 0xa0,0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,
  916. 0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,
  917. 0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,
  918. 0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,
  919. 0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,
  920. 0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
  921. 0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,
  922. 0x07,0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,
  923. 0x73,0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,
  924. 0x20,0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,
  925. 0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,
  926. 0x6d,0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,
  927. 0x80,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,
  928. 0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,
  929. 0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,
  930. 0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,
  931. 0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,
  932. 0x6d,0x60,0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,
  933. 0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,
  934. 0x07,0x7a,0x30,0x07,0x72,0x30,0x84,0x49,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
  935. 0x18,0xc2,0x38,0x40,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x64,0x81,0x00,0x00,0x00,
  936. 0x00,0x08,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,
  937. 0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02,0x50,0x04,0x85,0x50,0x10,0x65,0x40,0x70,
  938. 0x2c,0xa1,0x09,0x00,0x00,0x79,0x18,0x00,0x00,0xb9,0x00,0x00,0x00,0x1a,0x03,0x4c,
  939. 0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x42,
  940. 0x3c,0x00,0x84,0x50,0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,
  941. 0x2c,0xc2,0x23,0x2c,0x05,0xe7,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,
  942. 0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6,
  943. 0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06,
  944. 0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,0x26,0x65,0x88,0xf0,0x10,0x43,0x8c,0x45,
  945. 0x58,0x8c,0x65,0x60,0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x79,0x8e,0x45,0x58,0x84,
  946. 0x65,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,
  947. 0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x78,
  948. 0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,
  949. 0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x84,
  950. 0x67,0x61,0x19,0x84,0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,
  951. 0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,
  952. 0x7d,0x91,0xa5,0xcd,0x85,0x89,0xb1,0x95,0x0d,0x11,0x9e,0x86,0x51,0x58,0x9a,0x9c,
  953. 0x8b,0x5c,0x99,0x1b,0x59,0x99,0xdc,0x17,0x5d,0x98,0xdc,0x59,0x19,0x1d,0xa3,0xb0,
  954. 0x34,0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c,0xb8,0xb2,0x2f,0xb7,0xb0,0xb6,0x32,
  955. 0x1a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x64,0xc2,0xd2,0xe4,0x5c,0xc2,0xe4,0xce,0xbe,
  956. 0xdc,0xc2,0xda,0xca,0xa8,0x98,0xc9,0x85,0x9d,0x7d,0x8d,0xbd,0xb1,0xbd,0xc9,0x0d,
  957. 0x61,0x9e,0x67,0x19,0x1e,0xe8,0x89,0x1e,0xe9,0x99,0x86,0x08,0x0f,0x45,0x29,0x2c,
  958. 0x4d,0xce,0xc5,0x4c,0x2e,0xec,0xac,0xad,0xcc,0x8d,0xee,0x2b,0xcd,0x0d,0xae,0x8e,
  959. 0x8e,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,0xdb,0x98,0x1b,0x4c,0x0a,0x95,0xb0,0x34,
  960. 0x39,0x97,0xb1,0x32,0x37,0xba,0x32,0x39,0x3e,0x61,0x69,0x72,0x2e,0x70,0x65,0x72,
  961. 0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x34,0xcc,0xd8,0xde,0xc2,0xe8,0x64,0x28,
  962. 0xd4,0xd9,0x0d,0x91,0x96,0xe1,0xb1,0x9e,0xeb,0xc1,0x9e,0xec,0x81,0x1e,0xed,0x91,
  963. 0x9e,0x8d,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,0xdb,0x98,0x5b,0x4c,0x0a,0x8b,0xb1,
  964. 0x37,0xb6,0x37,0xb9,0x21,0xd2,0x22,0x3c,0xd6,0xd3,0x3d,0xd8,0x93,0x3d,0xd0,0x13,
  965. 0x3d,0xd2,0xe3,0x71,0x09,0x4b,0x93,0x73,0xa1,0x2b,0xc3,0xa3,0xab,0x93,0x2b,0xa3,
  966. 0x14,0x96,0x26,0xe7,0xc2,0xf6,0x36,0x16,0x46,0x97,0xf6,0xe6,0xf6,0x95,0xe6,0x46,
  967. 0x56,0x86,0x47,0x25,0x2c,0x4d,0xce,0x65,0x2e,0xac,0x0d,0x8e,0xad,0x8c,0x18,0x5d,
  968. 0x19,0x1e,0x5d,0x9d,0x5c,0x99,0x0c,0x19,0x8f,0x19,0xdb,0x5b,0x18,0x1d,0x0b,0xc8,
  969. 0x5c,0x58,0x1b,0x1c,0x5b,0x99,0x0f,0x07,0xba,0x32,0xbc,0x21,0xd4,0x42,0x3c,0x60,
  970. 0xf0,0x84,0xc1,0x32,0x2c,0xc2,0x23,0x06,0x0f,0xf4,0x8c,0xc1,0x23,0x3d,0x64,0xc0,
  971. 0x25,0x2c,0x4d,0xce,0x65,0x2e,0xac,0x0d,0x8e,0xad,0x4c,0x8e,0xc7,0x5c,0x58,0x1b,
  972. 0x1c,0x5b,0x99,0x1c,0x87,0xb9,0x36,0xb8,0x21,0xd2,0x72,0x3c,0x66,0xf0,0x84,0xc1,
  973. 0x32,0x2c,0xc2,0x03,0x3d,0x67,0xf0,0x48,0x0f,0x1a,0x0c,0x41,0x1e,0xee,0xf9,0x9e,
  974. 0x32,0x78,0xd2,0x60,0x88,0x91,0x00,0x4f,0xf5,0xa8,0xc1,0x88,0x88,0x1d,0xd8,0xc1,
  975. 0x1e,0xda,0xc1,0x0d,0xda,0xe1,0x1d,0xc8,0xa1,0x1e,0xd8,0xa1,0x1c,0xdc,0xc0,0x1c,
  976. 0xd8,0x21,0x1c,0xce,0x61,0x1e,0xa6,0x08,0xc1,0x30,0x42,0x61,0x07,0x76,0xb0,0x87,
  977. 0x76,0x70,0x83,0x74,0x20,0x87,0x72,0x70,0x07,0x7a,0x98,0x12,0x14,0x23,0x96,0x70,
  978. 0x48,0x07,0x79,0x70,0x03,0x7b,0x28,0x07,0x79,0x98,0x87,0x74,0x78,0x07,0x77,0x98,
  979. 0x12,0x18,0x23,0xa8,0x70,0x48,0x07,0x79,0x70,0x03,0x76,0x08,0x07,0x77,0x38,0x87,
  980. 0x7a,0x08,0x87,0x73,0x28,0x87,0x5f,0xb0,0x87,0x72,0x90,0x87,0x79,0x48,0x87,0x77,
  981. 0x70,0x87,0x29,0x01,0x32,0x62,0x0a,0x87,0x74,0x90,0x07,0x37,0x18,0x87,0x77,0x68,
  982. 0x07,0x78,0x48,0x07,0x76,0x28,0x87,0x5f,0x78,0x07,0x78,0xa0,0x87,0x74,0x78,0x07,
  983. 0x77,0x98,0x87,0x29,0x83,0xc2,0x38,0x23,0x98,0x70,0x48,0x07,0x79,0x70,0x03,0x73,
  984. 0x90,0x87,0x70,0x38,0x87,0x76,0x28,0x07,0x77,0xa0,0x87,0x29,0xc1,0x1a,0x00,0x00,
  985. 0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,
  986. 0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,
  987. 0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,
  988. 0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,
  989. 0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,
  990. 0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,
  991. 0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,
  992. 0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,
  993. 0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,
  994. 0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,
  995. 0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,
  996. 0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,
  997. 0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,
  998. 0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,
  999. 0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,
  1000. 0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,
  1001. 0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,
  1002. 0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,
  1003. 0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,
  1004. 0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,
  1005. 0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,
  1006. 0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,
  1007. 0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,
  1008. 0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,
  1009. 0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,
  1010. 0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,
  1011. 0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,
  1012. 0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,
  1013. 0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,
  1014. 0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4,
  1015. 0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43,
  1016. 0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,0x00,0x08,0x00,0x00,0x00,0x16,0xb0,0x01,
  1017. 0x48,0xe4,0x4b,0x00,0xf3,0x2c,0xc4,0x3f,0x11,0xd7,0x44,0x45,0xc4,0x6f,0x0f,0x7e,
  1018. 0x85,0x17,0xb7,0x6d,0x00,0x05,0x03,0x20,0x0d,0x0d,0x00,0x00,0x00,0x61,0x20,0x00,
  1019. 0x00,0x0c,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x04,0x00,0x00,
  1020. 0x00,0xc4,0x46,0x00,0x48,0x8d,0x00,0xd4,0x00,0x89,0x19,0x00,0x02,0x23,0x00,0x00,
  1021. 0x00,0x23,0x06,0x8a,0x10,0x44,0x87,0x91,0x0c,0x05,0x11,0x58,0x90,0xc8,0x67,0xb6,
  1022. 0x81,0x08,0x80,0x0c,0x00,0x00,0x00,0x00,0x00,
  1023. };
  1024. static const uint8_t _simgui_vs_bytecode_metal_ios[3052] = {
  1025. 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1026. 0xec,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1027. 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1028. 0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  1029. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
  1030. 0xe0,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,
  1031. 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
  1032. 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0x69,0x97,0x6b,0xac,0xd8,0xa2,0x51,
  1033. 0x33,0x7c,0x5f,0x96,0xb2,0xb1,0x06,0x06,0x7c,0xbb,0x5f,0x88,0xa0,0xeb,0x9f,0xea,
  1034. 0x6e,0x6b,0x70,0xa9,0x6e,0xef,0xe6,0xa4,0xea,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,
  1035. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1036. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08,
  1037. 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x37,0x00,0x00,0x00,0x56,0x41,0x54,
  1038. 0x54,0x22,0x00,0x03,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80,
  1039. 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f,
  1040. 0x72,0x30,0x00,0x02,0x80,0x56,0x41,0x54,0x59,0x05,0x00,0x03,0x00,0x04,0x04,0x06,
  1041. 0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,
  1042. 0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0xc0,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,
  1043. 0x42,0x43,0xc0,0xde,0x21,0x0c,0x00,0x00,0xad,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,
  1044. 0x02,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,
  1045. 0x06,0x10,0x32,0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,
  1046. 0x80,0x10,0x45,0x02,0x42,0x92,0x0b,0x42,0x84,0x10,0x32,0x14,0x38,0x08,0x18,0x49,
  1047. 0x0a,0x32,0x44,0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,
  1048. 0x24,0x07,0xc8,0x08,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,
  1049. 0x51,0x18,0x00,0x00,0x82,0x00,0x00,0x00,0x1b,0xc8,0x25,0xf8,0xff,0xff,0xff,0xff,
  1050. 0x01,0x90,0x80,0x8a,0x18,0x87,0x77,0x90,0x07,0x79,0x28,0x87,0x71,0xa0,0x07,0x76,
  1051. 0xc8,0x87,0x36,0x90,0x87,0x77,0xa8,0x07,0x77,0x20,0x87,0x72,0x20,0x87,0x36,0x20,
  1052. 0x87,0x74,0xb0,0x87,0x74,0x20,0x87,0x72,0x68,0x83,0x79,0x88,0x07,0x79,0xa0,0x87,
  1053. 0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0xc0,0x1c,0xc2,0x81,
  1054. 0x1d,0xe6,0xa1,0x1c,0x00,0x82,0x1c,0xd2,0x61,0x1e,0xc2,0x41,0x1c,0xd8,0xa1,0x1c,
  1055. 0xda,0x80,0x1e,0xc2,0x21,0x1d,0xd8,0xa1,0x0d,0xc6,0x21,0x1c,0xd8,0x81,0x1d,0xe6,
  1056. 0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07,0x80,0x60,0x87,0x72,0x98,0x87,0x79,
  1057. 0x68,0x03,0x78,0x90,0x87,0x72,0x18,0x87,0x74,0x98,0x87,0x72,0x68,0x03,0x73,0x80,
  1058. 0x87,0x76,0x08,0x07,0x72,0x00,0xcc,0x21,0x1c,0xd8,0x61,0x1e,0xca,0x01,0x20,0xdc,
  1059. 0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21,0x1c,0xda,0xa1,0x1c,0xda,0x00,0x1e,0xde,0x21,
  1060. 0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e,0xda,0xa0,0x1c,0xd8,0x21,0x1d,0xda,0x01,0xa0,
  1061. 0x07,0x79,0xa8,0x87,0x72,0x00,0x06,0x77,0x78,0x87,0x36,0x30,0x07,0x79,0x08,0x87,
  1062. 0x76,0x28,0x87,0x36,0x80,0x87,0x77,0x48,0x07,0x77,0xa0,0x87,0x72,0x90,0x87,0x36,
  1063. 0x28,0x07,0x76,0x48,0x87,0x76,0x68,0x03,0x77,0x78,0x07,0x77,0x68,0x03,0x76,0x28,
  1064. 0x87,0x70,0x30,0x07,0x80,0x70,0x87,0x77,0x68,0x83,0x74,0x70,0x07,0x73,0x98,0x87,
  1065. 0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,
  1066. 0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0x40,0x1d,0xea,0xa1,0x1d,0xe0,0xa1,0x0d,
  1067. 0xe8,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,
  1068. 0x72,0x00,0x08,0x77,0x78,0x87,0x36,0x70,0x87,0x70,0x70,0x87,0x79,0x68,0x03,0x73,
  1069. 0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,
  1070. 0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xe6,0x21,0x1d,0xce,0xc1,0x1d,0xca,0x81,0x1c,0xda,
  1071. 0x40,0x1f,0xca,0x41,0x1e,0xde,0x61,0x1e,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,
  1072. 0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,
  1073. 0x03,0x7a,0x90,0x87,0x70,0x80,0x07,0x78,0x48,0x07,0x77,0x38,0x87,0x36,0x68,0x87,
  1074. 0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0x62,0x1e,0xe8,0x21,
  1075. 0x1c,0xc6,0x61,0x1d,0xda,0x00,0x1e,0xe4,0xe1,0x1d,0xe8,0xa1,0x1c,0xc6,0x81,0x1e,
  1076. 0xde,0x41,0x1e,0xda,0x40,0x1c,0xea,0xc1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x0d,0xe6,
  1077. 0x21,0x1d,0xf4,0xa1,0x1c,0x00,0x3c,0x00,0x88,0x7a,0x70,0x87,0x79,0x08,0x07,0x73,
  1078. 0x28,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,
  1079. 0xe4,0xa1,0x1e,0xca,0x01,0x20,0xea,0x61,0x1e,0xca,0xa1,0x0d,0xe6,0xe1,0x1d,0xcc,
  1080. 0x81,0x1e,0xda,0xc0,0x1c,0xd8,0xe1,0x1d,0xc2,0x81,0x1e,0x00,0x73,0x08,0x07,0x76,
  1081. 0x98,0x87,0x72,0x00,0x36,0x20,0x02,0x01,0x24,0xc0,0x02,0x54,0x00,0x00,0x00,0x00,
  1082. 0x49,0x18,0x00,0x00,0x01,0x00,0x00,0x00,0x13,0x84,0x40,0x00,0x89,0x20,0x00,0x00,
  1083. 0x16,0x00,0x00,0x00,0x32,0x22,0x08,0x09,0x20,0x64,0x85,0x04,0x13,0x22,0xa4,0x84,
  1084. 0x04,0x13,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x88,0x8c,0x0b,0x84,0x84,0x4c,
  1085. 0x10,0x3c,0x33,0x00,0xc3,0x08,0x02,0x30,0x8c,0x40,0x00,0x76,0x08,0x91,0x83,0xa4,
  1086. 0x29,0xa2,0x84,0xc9,0xaf,0xa4,0xff,0x01,0x22,0x80,0x91,0x50,0x10,0x83,0x08,0x84,
  1087. 0x50,0x8a,0x89,0x90,0x22,0x1b,0x08,0x98,0x23,0x00,0x83,0x14,0xc8,0x39,0x02,0x50,
  1088. 0x18,0x44,0x08,0x84,0x61,0x04,0x22,0x19,0x01,0x00,0x00,0x00,0x13,0xa8,0x70,0x48,
  1089. 0x07,0x79,0xb0,0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,
  1090. 0x74,0x78,0x87,0x79,0xc8,0x03,0x37,0x80,0x03,0x37,0x80,0x83,0x0d,0xb7,0x51,0x0e,
  1091. 0x6d,0x00,0x0f,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
  1092. 0xd0,0x06,0xe9,0x10,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x78,0xa0,
  1093. 0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,0xe9,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,
  1094. 0x7a,0x10,0x07,0x76,0xd0,0x06,0xe9,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,
  1095. 0x30,0x07,0x72,0xd0,0x06,0xe9,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,
  1096. 0x07,0x74,0xd0,0x06,0xe6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,
  1097. 0x72,0xd0,0x06,0xe6,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
  1098. 0xd0,0x06,0xf6,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xd0,
  1099. 0x06,0xf6,0x20,0x07,0x74,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,
  1100. 0xf6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,0xf6,
  1101. 0x40,0x07,0x78,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x60,
  1102. 0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x90,0x07,
  1103. 0x76,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,
  1104. 0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,
  1105. 0x07,0x6d,0x60,0x0f,0x71,0x90,0x07,0x72,0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,
  1106. 0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07,0x75,
  1107. 0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x75,0x10,0x07,0x72,0xa0,
  1108. 0x07,0x75,0x10,0x07,0x72,0xa0,0x07,0x75,0x10,0x07,0x72,0xd0,0x06,0xf6,0x10,0x07,
  1109. 0x70,0x20,0x07,0x74,0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,
  1110. 0x20,0x07,0x74,0xd0,0x06,0xee,0x80,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x73,0x20,
  1111. 0x07,0x43,0x98,0x03,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x2c,0x10,0x00,0x00,
  1112. 0x09,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,
  1113. 0xc6,0x04,0x43,0xca,0x12,0x18,0x01,0x28,0x88,0x22,0x28,0x84,0x32,0xa0,0x1d,0x01,
  1114. 0x20,0x1d,0x4b,0x80,0x04,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0xe9,0x00,0x00,0x00,
  1115. 0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,
  1116. 0x21,0x46,0x42,0x20,0x80,0x82,0x50,0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,
  1117. 0x2b,0x1b,0x62,0x24,0x01,0x22,0x24,0x05,0xe7,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,
  1118. 0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x26,0x06,
  1119. 0x06,0x26,0xc6,0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,
  1120. 0x65,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,0x26,0x65,0x88,0x80,0x10,
  1121. 0x43,0x8c,0x24,0x48,0x86,0x44,0x60,0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x41,0x8e,
  1122. 0x24,0x48,0x82,0x44,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,
  1123. 0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,
  1124. 0x36,0x44,0x40,0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,
  1125. 0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,
  1126. 0x65,0x43,0x04,0x64,0x21,0x19,0x84,0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,
  1127. 0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,
  1128. 0xd1,0x8d,0xa1,0x7d,0x95,0xb9,0x85,0x89,0xb1,0x95,0x0d,0x11,0x90,0x86,0x51,0x58,
  1129. 0x9a,0x9c,0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0xd7,0x5b,0x1d,0x1d,0x5c,0x1d,0x1d,
  1130. 0x97,0xba,0xb9,0x32,0x39,0x14,0xb6,0xb7,0x31,0x37,0x98,0x14,0x46,0x61,0x69,0x72,
  1131. 0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x34,0xcc,
  1132. 0xd8,0xde,0xc2,0xe8,0x64,0xc8,0x84,0xa5,0xc9,0xb9,0x84,0xc9,0x9d,0x7d,0xb9,0x85,
  1133. 0xb5,0x95,0x51,0xa8,0xb3,0x1b,0xc2,0x20,0x0f,0x02,0x21,0x11,0x22,0x21,0x13,0x42,
  1134. 0x71,0xa9,0x9b,0x2b,0x93,0x43,0x61,0x7b,0x1b,0x73,0x8b,0x49,0xa1,0x61,0xc6,0xf6,
  1135. 0x16,0x46,0x47,0xc3,0x62,0xec,0x8d,0xed,0x4d,0x6e,0x08,0x83,0x3c,0x88,0x85,0x44,
  1136. 0xc8,0x85,0x4c,0x08,0x46,0x26,0x2c,0x4d,0xce,0x05,0xee,0x6d,0x2e,0x8d,0x2e,0xed,
  1137. 0xcd,0x8d,0xcb,0x19,0xdb,0x17,0xd4,0xdb,0x5c,0x1a,0x5d,0xda,0x9b,0xdb,0x10,0x05,
  1138. 0xd1,0x90,0x08,0xb9,0x90,0x09,0xd9,0x86,0x18,0x48,0x85,0x64,0x08,0x47,0x28,0x2c,
  1139. 0x4d,0xce,0xc5,0xae,0x4c,0x8e,0xae,0x0c,0xef,0x2b,0xcd,0x0d,0xae,0x8e,0x8e,0x52,
  1140. 0x58,0x9a,0x9c,0x0b,0xdb,0xdb,0x58,0x18,0x5d,0xda,0x9b,0xdb,0x57,0x9a,0x1b,0x59,
  1141. 0x19,0x1e,0xbd,0xb3,0x32,0xb7,0x32,0xb9,0x30,0xba,0x32,0x32,0x94,0xaf,0xaf,0xb0,
  1142. 0x34,0xb9,0x2f,0x38,0xb6,0xb0,0xb1,0x32,0xb4,0x37,0x36,0xb2,0x32,0xb9,0xaf,0xaf,
  1143. 0x14,0x22,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x43,0xa8,0x44,0x40,0x3c,0xe4,
  1144. 0x4b,0x84,0x24,0x40,0xc0,0x00,0x89,0x10,0x09,0x99,0x90,0x30,0x60,0x42,0x57,0x86,
  1145. 0x37,0xf6,0xf6,0x26,0x47,0x06,0x33,0x84,0x4a,0x02,0xc4,0x43,0xbe,0x24,0x48,0x02,
  1146. 0x04,0x0c,0x90,0x08,0x91,0x90,0x09,0x19,0x03,0x1a,0x63,0x6f,0x6c,0x6f,0x72,0x30,
  1147. 0x43,0xa8,0x84,0x40,0x3c,0xe4,0x4b,0x88,0x24,0x40,0xc0,0x00,0x89,0x90,0x0b,0x99,
  1148. 0x90,0x32,0xa0,0x12,0x96,0x26,0xe7,0x22,0x56,0x67,0x66,0x56,0x26,0xc7,0x27,0x2c,
  1149. 0x4d,0xce,0x45,0xac,0xce,0xcc,0xac,0x4c,0xee,0x6b,0x2e,0x4d,0xaf,0x8c,0x48,0x58,
  1150. 0x9a,0x9c,0x8b,0x5c,0x59,0x18,0x19,0xa9,0xb0,0x34,0x39,0x97,0x39,0x3a,0xb9,0xba,
  1151. 0x31,0xba,0x2f,0xba,0x3c,0xb8,0xb2,0xaf,0x34,0x37,0xb3,0x37,0x26,0x64,0x69,0x73,
  1152. 0x70,0x5f,0x73,0x69,0x7a,0x65,0x43,0x94,0x44,0x48,0x86,0x44,0x40,0x24,0x64,0x0d,
  1153. 0x18,0x85,0xa5,0xc9,0xb9,0x84,0xc9,0x9d,0x7d,0xd1,0xe5,0xc1,0x95,0x7d,0xcd,0xa5,
  1154. 0xe9,0x95,0xf1,0x0a,0x4b,0x93,0x73,0x09,0x93,0x3b,0xfb,0xa2,0xcb,0x83,0x2b,0xfb,
  1155. 0x0a,0x63,0x4b,0x3b,0x73,0xfb,0x9a,0x4b,0xd3,0x2b,0x63,0x62,0x37,0xf7,0x05,0x17,
  1156. 0x26,0x17,0xd6,0x36,0xc7,0xe1,0x4b,0x46,0x66,0x08,0x19,0x24,0x06,0x72,0x06,0x08,
  1157. 0x1a,0x24,0x03,0xf2,0x25,0x42,0x12,0x20,0x69,0x80,0xa8,0x01,0xc2,0x06,0x48,0x1b,
  1158. 0x24,0x03,0xe2,0x06,0xc9,0x80,0x44,0xc8,0x1b,0x20,0x13,0x02,0x07,0x43,0x10,0x44,
  1159. 0x0c,0x10,0x32,0x40,0xcc,0x00,0x89,0x83,0x21,0xc6,0x01,0x20,0x1d,0x22,0x07,0x7c,
  1160. 0xde,0xda,0xdc,0xd2,0xe0,0xde,0xe8,0xca,0xdc,0xe8,0x40,0xc6,0xd0,0xc2,0xe4,0xf8,
  1161. 0x4c,0xa5,0xb5,0xc1,0xb1,0x95,0x81,0x0c,0xad,0xac,0x80,0x50,0x09,0x05,0x05,0x0d,
  1162. 0x11,0x90,0x3a,0x18,0x62,0x20,0x74,0x80,0xd8,0xc1,0x72,0x0c,0x31,0x90,0x3b,0x40,
  1163. 0xee,0x60,0x39,0x46,0x44,0xec,0xc0,0x0e,0xf6,0xd0,0x0e,0x6e,0xd0,0x0e,0xef,0x40,
  1164. 0x0e,0xf5,0xc0,0x0e,0xe5,0xe0,0x06,0xe6,0xc0,0x0e,0xe1,0x70,0x0e,0xf3,0x30,0x45,
  1165. 0x08,0x86,0x11,0x0a,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,0xa4,0x03,0x39,0x94,0x83,
  1166. 0x3b,0xd0,0xc3,0x94,0xa0,0x18,0xb1,0x84,0x43,0x3a,0xc8,0x83,0x1b,0xd8,0x43,0x39,
  1167. 0xc8,0xc3,0x3c,0xa4,0xc3,0x3b,0xb8,0xc3,0x94,0xc0,0x18,0x41,0x85,0x43,0x3a,0xc8,
  1168. 0x83,0x1b,0xb0,0x43,0x38,0xb8,0xc3,0x39,0xd4,0x43,0x38,0x9c,0x43,0x39,0xfc,0x82,
  1169. 0x3d,0x94,0x83,0x3c,0xcc,0x43,0x3a,0xbc,0x83,0x3b,0x4c,0x09,0x90,0x11,0x53,0x38,
  1170. 0xa4,0x83,0x3c,0xb8,0xc1,0x38,0xbc,0x43,0x3b,0xc0,0x43,0x3a,0xb0,0x43,0x39,0xfc,
  1171. 0xc2,0x3b,0xc0,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x3c,0x4c,0x19,0x14,0xc6,0x19,
  1172. 0xa1,0x84,0x43,0x3a,0xc8,0x83,0x1b,0xd8,0x43,0x39,0xc8,0x03,0x3d,0x94,0x03,0x3e,
  1173. 0x4c,0x09,0xe6,0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,
  1174. 0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,
  1175. 0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,
  1176. 0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,
  1177. 0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,
  1178. 0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,
  1179. 0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,
  1180. 0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,
  1181. 0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,
  1182. 0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,
  1183. 0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,
  1184. 0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,
  1185. 0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,
  1186. 0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,
  1187. 0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,
  1188. 0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,
  1189. 0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,
  1190. 0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,
  1191. 0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,
  1192. 0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,
  1193. 0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,
  1194. 0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,
  1195. 0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,
  1196. 0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,
  1197. 0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,
  1198. 0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,
  1199. 0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,
  1200. 0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,
  1201. 0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,
  1202. 0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,0x38,0xa4,0x83,0x3c,0xb8,
  1203. 0x81,0x39,0xd4,0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c,0x83,
  1204. 0x3c,0xbc,0x43,0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,0x00,0x02,0x00,0x00,0x00,
  1205. 0x06,0x50,0x30,0x00,0xd2,0xd0,0x00,0x00,0x61,0x20,0x00,0x00,0x23,0x00,0x00,0x00,
  1206. 0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0xd4,0x63,0x11,0x40,
  1207. 0x60,0x1c,0x73,0x10,0x42,0xf0,0x3c,0x94,0x33,0x00,0x14,0x63,0x09,0x20,0x08,0x82,
  1208. 0xf0,0x2f,0x80,0x20,0x08,0xc2,0xbf,0x30,0x96,0x00,0x82,0x20,0x08,0x82,0x01,0x08,
  1209. 0x82,0x20,0x08,0x0e,0x33,0x00,0x24,0x73,0x10,0xd7,0x65,0x55,0x34,0x33,0x00,0x04,
  1210. 0x63,0x04,0x20,0x08,0x82,0xf8,0x37,0x46,0x00,0x82,0x20,0x08,0x7f,0x33,0x00,0x00,
  1211. 0xe3,0x0d,0x4c,0x64,0x51,0x40,0x2c,0x0a,0xe8,0x63,0xc1,0x02,0x1f,0x0b,0x16,0xf9,
  1212. 0x0c,0x32,0x04,0xcb,0x33,0xc8,0x10,0x2c,0xd1,0x6c,0xc3,0x52,0x01,0xb3,0x0d,0x41,
  1213. 0x15,0xcc,0x36,0x04,0x83,0x90,0x41,0x40,0x0c,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
  1214. 0x5b,0x86,0x20,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1215. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1216. };
  1217. static const uint8_t _simgui_fs_bytecode_metal_ios[2809] = {
  1218. 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1219. 0xf9,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1220. 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1221. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1222. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1223. 0x20,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,
  1224. 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
  1225. 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0xf0,0xa4,0xb3,0x95,0x4b,0xab,0x64,
  1226. 0x94,0xe7,0xa9,0x8a,0x69,0x27,0x6d,0x28,0x77,0x84,0x8d,0x3f,0xaf,0x7d,0x3c,0x39,
  1227. 0x31,0xc4,0xcb,0x53,0x6d,0xc0,0x0d,0xdf,0x08,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,
  1228. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1229. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08,
  1230. 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,
  1231. 0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,
  1232. 0x00,0x14,0x00,0x00,0x00,0x04,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,
  1233. 0xde,0x21,0x0c,0x00,0x00,0x7e,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,
  1234. 0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,
  1235. 0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,
  1236. 0x02,0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,
  1237. 0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,
  1238. 0x48,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,
  1239. 0x00,0x89,0x00,0x00,0x00,0x1b,0xcc,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x60,0x00,
  1240. 0x09,0xa8,0x88,0x71,0x78,0x07,0x79,0x90,0x87,0x72,0x18,0x07,0x7a,0x60,0x87,0x7c,
  1241. 0x68,0x03,0x79,0x78,0x87,0x7a,0x70,0x07,0x72,0x28,0x07,0x72,0x68,0x03,0x72,0x48,
  1242. 0x07,0x7b,0x48,0x07,0x72,0x28,0x87,0x36,0x98,0x87,0x78,0x90,0x07,0x7a,0x68,0x03,
  1243. 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xcc,0x21,0x1c,0xd8,0x61,
  1244. 0x1e,0xca,0x01,0x20,0xc8,0x21,0x1d,0xe6,0x21,0x1c,0xc4,0x81,0x1d,0xca,0xa1,0x0d,
  1245. 0xe8,0x21,0x1c,0xd2,0x81,0x1d,0xda,0x60,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0x1e,0x00,
  1246. 0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x76,0x28,0x87,0x79,0x98,0x87,0x36,
  1247. 0x80,0x07,0x79,0x28,0x87,0x71,0x48,0x87,0x79,0x28,0x87,0x36,0x30,0x07,0x78,0x68,
  1248. 0x87,0x70,0x20,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0xc2,0x1d,0xde,
  1249. 0xa1,0x0d,0xcc,0x41,0x1e,0xc2,0xa1,0x1d,0xca,0xa1,0x0d,0xe0,0xe1,0x1d,0xd2,0xc1,
  1250. 0x1d,0xe8,0xa1,0x1c,0xe4,0xa1,0x0d,0xca,0x81,0x1d,0xd2,0xa1,0x1d,0x00,0x7a,0x90,
  1251. 0x87,0x7a,0x28,0x07,0x60,0x70,0x87,0x77,0x68,0x03,0x73,0x90,0x87,0x70,0x68,0x87,
  1252. 0x72,0x68,0x03,0x78,0x78,0x87,0x74,0x70,0x07,0x7a,0x28,0x07,0x79,0x68,0x83,0x72,
  1253. 0x60,0x87,0x74,0x68,0x87,0x36,0x70,0x87,0x77,0x70,0x87,0x36,0x60,0x87,0x72,0x08,
  1254. 0x07,0x73,0x00,0x08,0x77,0x78,0x87,0x36,0x48,0x07,0x77,0x30,0x87,0x79,0x68,0x03,
  1255. 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,
  1256. 0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xd4,0xa1,0x1e,0xda,0x01,0x1e,0xda,0x80,0x1e,
  1257. 0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07,
  1258. 0x80,0x70,0x87,0x77,0x68,0x03,0x77,0x08,0x07,0x77,0x98,0x87,0x36,0x30,0x07,0x78,
  1259. 0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,
  1260. 0xdc,0xe1,0x1d,0xda,0x60,0x1e,0xd2,0xe1,0x1c,0xdc,0xa1,0x1c,0xc8,0xa1,0x0d,0xf4,
  1261. 0xa1,0x1c,0xe4,0xe1,0x1d,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81,
  1262. 0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0xa0,
  1263. 0x07,0x79,0x08,0x07,0x78,0x80,0x87,0x74,0x70,0x87,0x73,0x68,0x83,0x76,0x08,0x07,
  1264. 0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xe6,0x81,0x1e,0xc2,0x61,
  1265. 0x1c,0xd6,0xa1,0x0d,0xe0,0x41,0x1e,0xde,0x81,0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d,
  1266. 0xe4,0xa1,0x0d,0xc4,0xa1,0x1e,0xcc,0xc1,0x1c,0xca,0x41,0x1e,0xda,0x60,0x1e,0xd2,
  1267. 0x41,0x1f,0xca,0x01,0xc0,0x03,0x80,0xa8,0x07,0x77,0x98,0x87,0x70,0x30,0x87,0x72,
  1268. 0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,
  1269. 0xea,0xa1,0x1c,0x00,0xa2,0x1e,0xe6,0xa1,0x1c,0xda,0x60,0x1e,0xde,0xc1,0x1c,0xe8,
  1270. 0xa1,0x0d,0xcc,0x81,0x1d,0xde,0x21,0x1c,0xe8,0x01,0x30,0x87,0x70,0x60,0x87,0x79,
  1271. 0x28,0x07,0x60,0x83,0x21,0x0c,0xc0,0x02,0x54,0x1b,0x8c,0x81,0x00,0x16,0xa0,0xda,
  1272. 0x80,0x10,0xff,0xff,0xff,0xff,0x3f,0x00,0x0c,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80,
  1273. 0x05,0xa8,0x36,0x18,0x86,0x00,0x2c,0x40,0x05,0x49,0x18,0x00,0x00,0x03,0x00,0x00,
  1274. 0x00,0x13,0x86,0x40,0x18,0x26,0x0c,0x44,0x61,0x00,0x00,0x00,0x00,0x89,0x20,0x00,
  1275. 0x00,0x1d,0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,
  1276. 0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,
  1277. 0x4c,0x10,0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x30,0x8c,0x20,0x00,0x47,0x49,
  1278. 0x53,0x44,0x09,0x93,0xff,0x4f,0xc4,0x35,0x51,0x11,0xf1,0xdb,0xc3,0x3f,0x8d,0x11,
  1279. 0x00,0x83,0x08,0x44,0x70,0x91,0x34,0x45,0x94,0x30,0xf9,0xbf,0x04,0x30,0xcf,0x42,
  1280. 0x44,0xff,0x34,0x46,0x00,0x0c,0x22,0x18,0x42,0x29,0xc4,0x08,0xe5,0x10,0x9a,0x23,
  1281. 0x08,0xe6,0x08,0xc0,0x60,0x18,0x41,0x58,0x0a,0x12,0xca,0x19,0x8a,0x29,0x40,0x6d,
  1282. 0x20,0x20,0x05,0xd6,0x08,0x00,0x00,0x00,0x00,0x13,0xa8,0x70,0x48,0x07,0x79,0xb0,
  1283. 0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x74,0x78,0x87,
  1284. 0x79,0xc8,0x03,0x37,0x80,0x03,0x37,0x80,0x83,0x0d,0xb7,0x51,0x0e,0x6d,0x00,0x0f,
  1285. 0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xe9,
  1286. 0x10,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x78,0xa0,0x07,0x78,0xa0,
  1287. 0x07,0x78,0xd0,0x06,0xe9,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07,
  1288. 0x76,0xd0,0x06,0xe9,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,
  1289. 0xd0,0x06,0xe9,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,
  1290. 0x06,0xe6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,
  1291. 0xe6,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,
  1292. 0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xd0,0x06,0xf6,0x20,
  1293. 0x07,0x74,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,0xf6,0x30,0x07,
  1294. 0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,0xf6,0x40,0x07,0x78,
  1295. 0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x60,0x07,0x74,0xa0,
  1296. 0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x90,0x07,0x76,0xa0,0x07,
  1297. 0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x72,
  1298. 0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x6d,0x60,
  1299. 0x0f,0x71,0x90,0x07,0x72,0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,
  1300. 0x76,0xd0,0x06,0xf6,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x7a,
  1301. 0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x75,0x10,0x07,0x72,0xa0,0x07,0x75,0x10,
  1302. 0x07,0x72,0xa0,0x07,0x75,0x10,0x07,0x72,0xd0,0x06,0xf6,0x10,0x07,0x70,0x20,0x07,
  1303. 0x74,0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,
  1304. 0xd0,0x06,0xee,0x80,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x73,0x20,0x07,0x43,0x98,
  1305. 0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x21,0x8c,0x03,0x04,0x80,0x00,0x00,
  1306. 0x00,0x00,0x00,0x40,0x16,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x32,0x1e,0x98,
  1307. 0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02,
  1308. 0x50,0x04,0x85,0x50,0x10,0x65,0x40,0x70,0x2c,0x01,0x12,0x00,0x00,0x79,0x18,0x00,
  1309. 0x00,0xb9,0x00,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,
  1310. 0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x42,0x3c,0x00,0x84,0x50,0xb9,0x1b,0x43,0x0b,
  1311. 0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x2c,0xc2,0x23,0x2c,0x05,0xe7,0x20,0x08,
  1312. 0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,
  1313. 0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,
  1314. 0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,
  1315. 0x26,0x65,0x88,0xf0,0x10,0x43,0x8c,0x45,0x58,0x8c,0x65,0x60,0xd1,0x54,0x46,0x17,
  1316. 0xc6,0x36,0x04,0x79,0x8e,0x45,0x58,0x84,0x65,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,
  1317. 0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,
  1318. 0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x78,0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,
  1319. 0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,
  1320. 0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x84,0x67,0x21,0x19,0x84,0xa5,0xc9,0xb9,0x8c,
  1321. 0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,
  1322. 0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x95,0xb9,0x85,0x89,0xb1,0x95,0x0d,
  1323. 0x11,0x9e,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5c,0x99,0x1b,0x59,0x99,0xdc,0x17,0x5d,
  1324. 0x98,0xdc,0x59,0x19,0x1d,0xa3,0xb0,0x34,0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c,
  1325. 0xb8,0xb2,0x2f,0xb7,0xb0,0xb6,0x32,0x1a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x64,0xc2,
  1326. 0xd2,0xe4,0x5c,0xc2,0xe4,0xce,0xbe,0xdc,0xc2,0xda,0xca,0xa8,0x98,0xc9,0x85,0x9d,
  1327. 0x7d,0x8d,0xbd,0xb1,0xbd,0xc9,0x0d,0x61,0x9e,0x67,0x19,0x1e,0xe8,0x89,0x1e,0xe9,
  1328. 0x99,0x86,0x08,0x0f,0x45,0x29,0x2c,0x4d,0xce,0xc5,0x4c,0x2e,0xec,0xac,0xad,0xcc,
  1329. 0x8d,0xee,0x2b,0xcd,0x0d,0xae,0x8e,0x8e,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,0xdb,
  1330. 0x98,0x1b,0x4c,0x0a,0x95,0xb0,0x34,0x39,0x97,0xb1,0x32,0x37,0xba,0x32,0x39,0x3e,
  1331. 0x61,0x69,0x72,0x2e,0x70,0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x34,
  1332. 0xcc,0xd8,0xde,0xc2,0xe8,0x64,0x28,0xd4,0xd9,0x0d,0x91,0x96,0xe1,0xb1,0x9e,0xeb,
  1333. 0xc1,0x9e,0xec,0x81,0x1e,0xed,0x91,0x9e,0x8d,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,
  1334. 0xdb,0x98,0x5b,0x4c,0x0a,0x8b,0xb1,0x37,0xb6,0x37,0xb9,0x21,0xd2,0x22,0x3c,0xd6,
  1335. 0xd3,0x3d,0xd8,0x93,0x3d,0xd0,0x13,0x3d,0xd2,0xe3,0x71,0x09,0x4b,0x93,0x73,0xa1,
  1336. 0x2b,0xc3,0xa3,0xab,0x93,0x2b,0xa3,0x14,0x96,0x26,0xe7,0xc2,0xf6,0x36,0x16,0x46,
  1337. 0x97,0xf6,0xe6,0xf6,0x95,0xe6,0x46,0x56,0x86,0x47,0x25,0x2c,0x4d,0xce,0x65,0x2e,
  1338. 0xac,0x0d,0x8e,0xad,0x8c,0x18,0x5d,0x19,0x1e,0x5d,0x9d,0x5c,0x99,0x0c,0x19,0x8f,
  1339. 0x19,0xdb,0x5b,0x18,0x1d,0x0b,0xc8,0x5c,0x58,0x1b,0x1c,0x5b,0x99,0x0f,0x07,0xba,
  1340. 0x32,0xbc,0x21,0xd4,0x42,0x3c,0x60,0xf0,0x84,0xc1,0x32,0x2c,0xc2,0x23,0x06,0x0f,
  1341. 0xf4,0x8c,0xc1,0x23,0x3d,0x64,0xc0,0x25,0x2c,0x4d,0xce,0x65,0x2e,0xac,0x0d,0x8e,
  1342. 0xad,0x4c,0x8e,0xc7,0x5c,0x58,0x1b,0x1c,0x5b,0x99,0x1c,0x87,0xb9,0x36,0xb8,0x21,
  1343. 0xd2,0x72,0x3c,0x66,0xf0,0x84,0xc1,0x32,0x2c,0xc2,0x03,0x3d,0x67,0xf0,0x48,0x0f,
  1344. 0x1a,0x0c,0x41,0x1e,0xee,0xf9,0x9e,0x32,0x78,0xd2,0x60,0x88,0x91,0x00,0x4f,0xf5,
  1345. 0xa8,0xc1,0x88,0x88,0x1d,0xd8,0xc1,0x1e,0xda,0xc1,0x0d,0xda,0xe1,0x1d,0xc8,0xa1,
  1346. 0x1e,0xd8,0xa1,0x1c,0xdc,0xc0,0x1c,0xd8,0x21,0x1c,0xce,0x61,0x1e,0xa6,0x08,0xc1,
  1347. 0x30,0x42,0x61,0x07,0x76,0xb0,0x87,0x76,0x70,0x83,0x74,0x20,0x87,0x72,0x70,0x07,
  1348. 0x7a,0x98,0x12,0x14,0x23,0x96,0x70,0x48,0x07,0x79,0x70,0x03,0x7b,0x28,0x07,0x79,
  1349. 0x98,0x87,0x74,0x78,0x07,0x77,0x98,0x12,0x18,0x23,0xa8,0x70,0x48,0x07,0x79,0x70,
  1350. 0x03,0x76,0x08,0x07,0x77,0x38,0x87,0x7a,0x08,0x87,0x73,0x28,0x87,0x5f,0xb0,0x87,
  1351. 0x72,0x90,0x87,0x79,0x48,0x87,0x77,0x70,0x87,0x29,0x01,0x32,0x62,0x0a,0x87,0x74,
  1352. 0x90,0x07,0x37,0x18,0x87,0x77,0x68,0x07,0x78,0x48,0x07,0x76,0x28,0x87,0x5f,0x78,
  1353. 0x07,0x78,0xa0,0x87,0x74,0x78,0x07,0x77,0x98,0x87,0x29,0x83,0xc2,0x38,0x23,0x98,
  1354. 0x70,0x48,0x07,0x79,0x70,0x03,0x73,0x90,0x87,0x70,0x38,0x87,0x76,0x28,0x07,0x77,
  1355. 0xa0,0x87,0x29,0xc1,0x1a,0x00,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,
  1356. 0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,
  1357. 0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,
  1358. 0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,
  1359. 0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,
  1360. 0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,
  1361. 0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,
  1362. 0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,
  1363. 0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,
  1364. 0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,
  1365. 0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,
  1366. 0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,
  1367. 0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,
  1368. 0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,
  1369. 0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,
  1370. 0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,
  1371. 0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,
  1372. 0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,
  1373. 0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,
  1374. 0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,
  1375. 0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,
  1376. 0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,
  1377. 0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,
  1378. 0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,
  1379. 0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,
  1380. 0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,
  1381. 0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,
  1382. 0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,
  1383. 0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,
  1384. 0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,
  1385. 0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4,0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,
  1386. 0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43,0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,
  1387. 0x00,0x08,0x00,0x00,0x00,0x16,0xb0,0x01,0x48,0xe4,0x4b,0x00,0xf3,0x2c,0xc4,0x3f,
  1388. 0x11,0xd7,0x44,0x45,0xc4,0x6f,0x0f,0x7e,0x85,0x17,0xb7,0x6d,0x00,0x05,0x03,0x20,
  1389. 0x0d,0x0d,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x0c,0x00,0x00,0x00,0x13,0x04,0x41,
  1390. 0x2c,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xc4,0x46,0x00,0x48,0x8d,0x00,0xd4,
  1391. 0x00,0x89,0x19,0x00,0x02,0x23,0x00,0x00,0x00,0x23,0x06,0x8a,0x10,0x44,0x87,0x91,
  1392. 0x0c,0x05,0x11,0x58,0x90,0xc8,0x67,0xb6,0x81,0x08,0x80,0x0c,0x00,0x00,0x00,0x00,
  1393. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1394. };
  1395. static const char _simgui_vs_source_metal_sim[672] = {
  1396. 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
  1397. 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
  1398. 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
  1399. 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
  1400. 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
  1401. 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
  1402. 0x6c,0x6f,0x61,0x74,0x32,0x20,0x64,0x69,0x73,0x70,0x5f,0x73,0x69,0x7a,0x65,0x3b,
  1403. 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,
  1404. 0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
  1405. 0x74,0x32,0x20,0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,
  1406. 0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
  1407. 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,
  1408. 0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
  1409. 0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
  1410. 0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,
  1411. 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
  1412. 0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,
  1413. 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,
  1414. 0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
  1415. 0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,
  1416. 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,
  1417. 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,
  1418. 0x72,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,
  1419. 0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,
  1420. 0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,
  1421. 0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,
  1422. 0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,
  1423. 0x6e,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,
  1424. 0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,
  1425. 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,
  1426. 0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
  1427. 0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,
  1428. 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,
  1429. 0x69,0x74,0x69,0x6f,0x6e,0x20,0x2f,0x20,0x5f,0x32,0x32,0x2e,0x64,0x69,0x73,0x70,
  1430. 0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,
  1431. 0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x32,
  1432. 0x2e,0x30,0x2c,0x20,0x2d,0x32,0x2e,0x30,0x29,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,
  1433. 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,
  1434. 0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,
  1435. 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
  1436. 0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,
  1437. 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
  1438. };
  1439. static const char _simgui_fs_source_metal_sim[436] = {
  1440. 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
  1441. 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
  1442. 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
  1443. 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
  1444. 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
  1445. 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
  1446. 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
  1447. 0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,
  1448. 0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
  1449. 0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,
  1450. 0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,
  1451. 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,
  1452. 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
  1453. 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,
  1454. 0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,
  1455. 0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,
  1456. 0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,
  1457. 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,
  1458. 0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,
  1459. 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,
  1460. 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,
  1461. 0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,
  1462. 0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
  1463. 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,
  1464. 0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,
  1465. 0x75,0x76,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,
  1466. 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,
  1467. 0x7d,0x0a,0x0a,0x00,
  1468. };
  1469. #elif defined(SOKOL_D3D11)
  1470. static const uint8_t _simgui_vs_bytecode_hlsl4[892] = {
  1471. 0x44,0x58,0x42,0x43,0x0d,0xbd,0x9e,0x9e,0x7d,0xc0,0x2b,0x54,0x88,0xf9,0xca,0x89,
  1472. 0x32,0xe4,0x0c,0x59,0x01,0x00,0x00,0x00,0x7c,0x03,0x00,0x00,0x05,0x00,0x00,0x00,
  1473. 0x34,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x60,0x01,0x00,0x00,0xd0,0x01,0x00,0x00,
  1474. 0x00,0x03,0x00,0x00,0x52,0x44,0x45,0x46,0xc0,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1475. 0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xfe,0xff,
  1476. 0x10,0x81,0x00,0x00,0x98,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1477. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1478. 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
  1479. 0x73,0x00,0xab,0xab,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,
  1480. 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
  1481. 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x88,0x00,0x00,0x00,
  1482. 0x00,0x00,0x00,0x00,0x5f,0x32,0x32,0x5f,0x64,0x69,0x73,0x70,0x5f,0x73,0x69,0x7a,
  1483. 0x65,0x00,0xab,0xab,0x01,0x00,0x03,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,
  1484. 0x00,0x00,0x00,0x00,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x28,0x52,
  1485. 0x29,0x20,0x48,0x4c,0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,0x72,0x20,0x43,0x6f,
  1486. 0x6d,0x70,0x69,0x6c,0x65,0x72,0x20,0x31,0x30,0x2e,0x31,0x00,0x49,0x53,0x47,0x4e,
  1487. 0x5c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x50,0x00,0x00,0x00,
  1488. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1489. 0x03,0x03,0x00,0x00,0x50,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1490. 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x50,0x00,0x00,0x00,
  1491. 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
  1492. 0x0f,0x0f,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x00,0xab,0xab,0xab,
  1493. 0x4f,0x53,0x47,0x4e,0x68,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
  1494. 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
  1495. 0x00,0x00,0x00,0x00,0x03,0x0c,0x00,0x00,0x50,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1496. 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
  1497. 0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
  1498. 0x02,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
  1499. 0x00,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0xab,0xab,0xab,
  1500. 0x53,0x48,0x44,0x52,0x28,0x01,0x00,0x00,0x40,0x00,0x01,0x00,0x4a,0x00,0x00,0x00,
  1501. 0x59,0x00,0x00,0x04,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1502. 0x5f,0x00,0x00,0x03,0x32,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,
  1503. 0x32,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00,
  1504. 0x02,0x00,0x00,0x00,0x65,0x00,0x00,0x03,0x32,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
  1505. 0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x67,0x00,0x00,0x04,
  1506. 0xf2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x68,0x00,0x00,0x02,
  1507. 0x01,0x00,0x00,0x00,0x36,0x00,0x00,0x05,0x32,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
  1508. 0x46,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x36,0x00,0x00,0x05,0xf2,0x20,0x10,0x00,
  1509. 0x01,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x02,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,
  1510. 0x32,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x10,0x10,0x00,0x00,0x00,0x00,0x00,
  1511. 0x46,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,
  1512. 0x32,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x00,0x10,0x00,0x00,0x00,0x00,0x00,
  1513. 0x02,0x40,0x00,0x00,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,
  1514. 0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x0a,0x32,0x20,0x10,0x00,0x02,0x00,0x00,0x00,
  1515. 0x46,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x40,
  1516. 0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x08,
  1517. 0xc2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  1518. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x80,0x3f,0x3e,0x00,0x00,0x01,
  1519. 0x53,0x54,0x41,0x54,0x74,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1520. 0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1521. 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1522. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1523. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1524. 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1525. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1526. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1527. };
  1528. static const uint8_t _simgui_fs_bytecode_hlsl4[608] = {
  1529. 0x44,0x58,0x42,0x43,0x3a,0xa7,0x41,0x21,0xb4,0x2d,0xa7,0x6e,0xfe,0x31,0xb0,0xe0,
  1530. 0x14,0xe0,0xdf,0x5a,0x01,0x00,0x00,0x00,0x60,0x02,0x00,0x00,0x05,0x00,0x00,0x00,
  1531. 0x34,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x48,0x01,0x00,0x00,
  1532. 0xe4,0x01,0x00,0x00,0x52,0x44,0x45,0x46,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1533. 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xff,0xff,
  1534. 0x10,0x81,0x00,0x00,0x64,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
  1535. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1536. 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
  1537. 0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
  1538. 0x01,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x73,0x6d,0x70,0x00,0x74,0x65,0x78,0x00,
  1539. 0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c,
  1540. 0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c,
  1541. 0x65,0x72,0x20,0x31,0x30,0x2e,0x31,0x00,0x49,0x53,0x47,0x4e,0x44,0x00,0x00,0x00,
  1542. 0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1543. 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x00,0x00,
  1544. 0x38,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
  1545. 0x01,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
  1546. 0x00,0xab,0xab,0xab,0x4f,0x53,0x47,0x4e,0x2c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1547. 0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1548. 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x53,0x56,0x5f,0x54,
  1549. 0x61,0x72,0x67,0x65,0x74,0x00,0xab,0xab,0x53,0x48,0x44,0x52,0x94,0x00,0x00,0x00,
  1550. 0x40,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x5a,0x00,0x00,0x03,0x00,0x60,0x10,0x00,
  1551. 0x00,0x00,0x00,0x00,0x58,0x18,0x00,0x04,0x00,0x70,0x10,0x00,0x00,0x00,0x00,0x00,
  1552. 0x55,0x55,0x00,0x00,0x62,0x10,0x00,0x03,0x32,0x10,0x10,0x00,0x00,0x00,0x00,0x00,
  1553. 0x62,0x10,0x00,0x03,0xf2,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03,
  1554. 0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x02,0x01,0x00,0x00,0x00,
  1555. 0x45,0x00,0x00,0x09,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x10,0x10,0x00,
  1556. 0x00,0x00,0x00,0x00,0x46,0x7e,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x10,0x00,
  1557. 0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x07,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
  1558. 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x01,0x00,0x00,0x00,
  1559. 0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54,0x74,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
  1560. 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
  1561. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1562. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1563. 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1564. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1565. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1566. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1567. };
  1568. #elif defined(SOKOL_WGPU)
  1569. static const char _simgui_vs_source_wgsl[1083] = {
  1570. 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
  1571. 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
  1572. 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
  1573. 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
  1574. 0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
  1575. 0x20,0x64,0x69,0x73,0x70,0x5f,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x76,0x65,0x63,
  1576. 0x32,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
  1577. 0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3a,
  1578. 0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,
  1579. 0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,
  1580. 0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x32,0x32,
  1581. 0x20,0x3a,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,
  1582. 0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,
  1583. 0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
  1584. 0x76,0x61,0x74,0x65,0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,
  1585. 0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,
  1586. 0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,
  1587. 0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
  1588. 0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,
  1589. 0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,
  1590. 0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,
  1591. 0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,
  1592. 0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,
  1593. 0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,
  1594. 0x69,0x6f,0x6e,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,
  1595. 0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x78,0x5f,0x32,0x32,
  1596. 0x2e,0x64,0x69,0x73,0x70,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,
  1597. 0x74,0x20,0x78,0x5f,0x33,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,
  1598. 0x20,0x28,0x28,0x28,0x78,0x5f,0x31,0x39,0x20,0x2f,0x20,0x78,0x5f,0x32,0x35,0x29,
  1599. 0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,
  1600. 0x2e,0x35,0x66,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x32,0x2e,
  1601. 0x30,0x66,0x2c,0x20,0x2d,0x32,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x67,
  1602. 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,
  1603. 0x34,0x66,0x28,0x78,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x33,0x2e,
  1604. 0x79,0x2c,0x20,0x30,0x2e,0x35,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,
  1605. 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,
  1606. 0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,
  1607. 0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x78,0x5f,0x34,0x33,0x3b,0x0a,0x20,0x20,0x6c,
  1608. 0x65,0x74,0x20,0x78,0x5f,0x34,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,
  1609. 0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,
  1610. 0x72,0x20,0x3d,0x20,0x78,0x5f,0x34,0x37,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,
  1611. 0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,
  1612. 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,
  1613. 0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,
  1614. 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,
  1615. 0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
  1616. 0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,
  1617. 0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
  1618. 0x31,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,
  1619. 0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,
  1620. 0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,
  1621. 0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
  1622. 0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,
  1623. 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x74,0x65,0x78,
  1624. 0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,
  1625. 0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
  1626. 0x32,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,
  1627. 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,
  1628. 0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
  1629. 0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
  1630. 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,
  1631. 0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,
  1632. 0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,
  1633. 0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,
  1634. 0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,
  1635. 0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,
  1636. 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x75,0x76,0x2c,0x20,0x63,
  1637. 0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
  1638. };
  1639. static const char _simgui_fs_source_wgsl[630] = {
  1640. 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
  1641. 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
  1642. 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
  1643. 0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
  1644. 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,
  1645. 0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x33,0x32,
  1646. 0x29,0x20,0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,
  1647. 0x75,0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,
  1648. 0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,
  1649. 0x28,0x34,0x38,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,
  1650. 0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
  1651. 0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,
  1652. 0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,
  1653. 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,
  1654. 0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,
  1655. 0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,
  1656. 0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,
  1657. 0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,
  1658. 0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,
  1659. 0x6d,0x70,0x2c,0x20,0x78,0x5f,0x32,0x33,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,
  1660. 0x20,0x78,0x5f,0x32,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,
  1661. 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
  1662. 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x34,0x20,0x2a,0x20,0x78,0x5f,
  1663. 0x32,0x37,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,
  1664. 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,
  1665. 0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
  1666. 0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,
  1667. 0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,
  1668. 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,
  1669. 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76,0x5f,
  1670. 0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,
  1671. 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x63,0x6f,0x6c,0x6f,
  1672. 0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,
  1673. 0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,
  1674. 0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,
  1675. 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,
  1676. 0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,
  1677. 0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,
  1678. 0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,
  1679. 0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
  1680. };
  1681. #elif defined(SOKOL_DUMMY_BACKEND)
  1682. static const char* _simgui_vs_source_dummy = "";
  1683. static const char* _simgui_fs_source_dummy = "";
  1684. #else
  1685. #error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
  1686. #endif
  1687. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  1688. static void _simgui_set_clipboard(void* user_data, const char* text) {
  1689. (void)user_data;
  1690. sapp_set_clipboard_string(text);
  1691. }
  1692. static const char* _simgui_get_clipboard(void* user_data) {
  1693. (void)user_data;
  1694. return sapp_get_clipboard_string();
  1695. }
  1696. #endif
  1697. #if defined(__EMSCRIPTEN__) && !defined(SOKOL_DUMMY_BACKEND)
  1698. EM_JS(int, simgui_js_is_osx, (void), {
  1699. if (navigator.userAgent.includes('Macintosh')) {
  1700. return 1;
  1701. } else {
  1702. return 0;
  1703. }
  1704. });
  1705. #endif
  1706. // ██ ██████ ██████ ██████ ██ ███ ██ ██████
  1707. // ██ ██ ██ ██ ██ ██ ████ ██ ██
  1708. // ██ ██ ██ ██ ███ ██ ███ ██ ██ ██ ██ ██ ███
  1709. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
  1710. // ███████ ██████ ██████ ██████ ██ ██ ████ ██████
  1711. //
  1712. // >>logging
  1713. #if defined(SOKOL_DEBUG)
  1714. #define _SIMGUI_LOGITEM_XMACRO(item,msg) #item ": " msg,
  1715. static const char* _simgui_log_messages[] = {
  1716. _SIMGUI_LOG_ITEMS
  1717. };
  1718. #undef _SIMGUI_LOGITEM_XMACRO
  1719. #endif // SOKOL_DEBUG
  1720. #define _SIMGUI_PANIC(code) _simgui_log(SIMGUI_LOGITEM_ ##code, 0, 0, __LINE__)
  1721. #define _SIMGUI_ERROR(code) _simgui_log(SIMGUI_LOGITEM_ ##code, 1, 0, __LINE__)
  1722. #define _SIMGUI_WARN(code) _simgui_log(SIMGUI_LOGITEM_ ##code, 2, 0, __LINE__)
  1723. #define _SIMGUI_INFO(code) _simgui_log(SIMGUI_LOGITEM_ ##code, 3, 0, __LINE__)
  1724. #define _SIMGUI_LOGMSG(code,msg) _simgui_log(SIMGUI_LOGITEM_ ##code, 3, msg, __LINE__)
  1725. static void _simgui_log(simgui_log_item_t log_item, uint32_t log_level, const char* msg, uint32_t line_nr) {
  1726. if (_simgui.desc.logger.func) {
  1727. const char* filename = 0;
  1728. #if defined(SOKOL_DEBUG)
  1729. filename = __FILE__;
  1730. if (0 == msg) {
  1731. msg = _simgui_log_messages[log_item];
  1732. }
  1733. #endif
  1734. _simgui.desc.logger.func("simgui", log_level, log_item, msg, line_nr, filename, _simgui.desc.logger.user_data);
  1735. } else {
  1736. // for log level PANIC it would be 'undefined behaviour' to continue
  1737. if (log_level == 0) {
  1738. abort();
  1739. }
  1740. }
  1741. }
  1742. // ███ ███ ███████ ███ ███ ██████ ██████ ██ ██
  1743. // ████ ████ ██ ████ ████ ██ ██ ██ ██ ██ ██
  1744. // ██ ████ ██ █████ ██ ████ ██ ██ ██ ██████ ████
  1745. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
  1746. // ██ ██ ███████ ██ ██ ██████ ██ ██ ██
  1747. //
  1748. // >>memory
  1749. static void _simgui_clear(void* ptr, size_t size) {
  1750. SOKOL_ASSERT(ptr && (size > 0));
  1751. memset(ptr, 0, size);
  1752. }
  1753. static void* _simgui_malloc(size_t size) {
  1754. SOKOL_ASSERT(size > 0);
  1755. void* ptr;
  1756. if (_simgui.desc.allocator.alloc_fn) {
  1757. ptr = _simgui.desc.allocator.alloc_fn(size, _simgui.desc.allocator.user_data);
  1758. } else {
  1759. ptr = malloc(size);
  1760. }
  1761. if (0 == ptr) {
  1762. _SIMGUI_PANIC(MALLOC_FAILED);
  1763. }
  1764. return ptr;
  1765. }
  1766. static void* _simgui_malloc_clear(size_t size) {
  1767. void* ptr = _simgui_malloc(size);
  1768. _simgui_clear(ptr, size);
  1769. return ptr;
  1770. }
  1771. static void _simgui_free(void* ptr) {
  1772. if (_simgui.desc.allocator.free_fn) {
  1773. _simgui.desc.allocator.free_fn(ptr, _simgui.desc.allocator.user_data);
  1774. } else {
  1775. free(ptr);
  1776. }
  1777. }
  1778. // ██████ ██████ ██████ ██
  1779. // ██ ██ ██ ██ ██ ██ ██
  1780. // ██████ ██ ██ ██ ██ ██
  1781. // ██ ██ ██ ██ ██ ██
  1782. // ██ ██████ ██████ ███████
  1783. //
  1784. // >>pool
  1785. static void _simgui_init_pool(_simgui_pool_t* pool, int num) {
  1786. SOKOL_ASSERT(pool && (num >= 1));
  1787. // slot 0 is reserved for the 'invalid id', so bump the pool size by 1
  1788. pool->size = num + 1;
  1789. pool->queue_top = 0;
  1790. // generation counters indexable by pool slot index, slot 0 is reserved
  1791. size_t gen_ctrs_size = sizeof(uint32_t) * (size_t)pool->size;
  1792. pool->gen_ctrs = (uint32_t*) _simgui_malloc_clear(gen_ctrs_size);
  1793. // it's not a bug to only reserve 'num' here
  1794. pool->free_queue = (int*) _simgui_malloc_clear(sizeof(int) * (size_t)num);
  1795. // never allocate the zero-th pool item since the invalid id is 0
  1796. for (int i = pool->size-1; i >= 1; i--) {
  1797. pool->free_queue[pool->queue_top++] = i;
  1798. }
  1799. }
  1800. static void _simgui_discard_pool(_simgui_pool_t* pool) {
  1801. SOKOL_ASSERT(pool);
  1802. SOKOL_ASSERT(pool->free_queue);
  1803. _simgui_free(pool->free_queue);
  1804. pool->free_queue = 0;
  1805. SOKOL_ASSERT(pool->gen_ctrs);
  1806. _simgui_free(pool->gen_ctrs);
  1807. pool->gen_ctrs = 0;
  1808. pool->size = 0;
  1809. pool->queue_top = 0;
  1810. }
  1811. static int _simgui_pool_alloc_index(_simgui_pool_t* pool) {
  1812. SOKOL_ASSERT(pool);
  1813. SOKOL_ASSERT(pool->free_queue);
  1814. if (pool->queue_top > 0) {
  1815. int slot_index = pool->free_queue[--pool->queue_top];
  1816. SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size));
  1817. return slot_index;
  1818. } else {
  1819. // pool exhausted
  1820. return _SIMGUI_INVALID_SLOT_INDEX;
  1821. }
  1822. }
  1823. static void _simgui_pool_free_index(_simgui_pool_t* pool, int slot_index) {
  1824. SOKOL_ASSERT((slot_index > _SIMGUI_INVALID_SLOT_INDEX) && (slot_index < pool->size));
  1825. SOKOL_ASSERT(pool);
  1826. SOKOL_ASSERT(pool->free_queue);
  1827. SOKOL_ASSERT(pool->queue_top < pool->size);
  1828. #ifdef SOKOL_DEBUG
  1829. // debug check against double-free
  1830. for (int i = 0; i < pool->queue_top; i++) {
  1831. SOKOL_ASSERT(pool->free_queue[i] != slot_index);
  1832. }
  1833. #endif
  1834. pool->free_queue[pool->queue_top++] = slot_index;
  1835. SOKOL_ASSERT(pool->queue_top <= (pool->size-1));
  1836. }
  1837. /* initialize a pool slot:
  1838. - bump the slot's generation counter
  1839. - create a resource id from the generation counter and slot index
  1840. - set the slot's id to this id
  1841. - set the slot's state to ALLOC
  1842. - return the handle id
  1843. */
  1844. static uint32_t _simgui_slot_init(_simgui_pool_t* pool, _simgui_slot_t* slot, int slot_index) {
  1845. /* FIXME: add handling for an overflowing generation counter,
  1846. for now, just overflow (another option is to disable
  1847. the slot)
  1848. */
  1849. SOKOL_ASSERT(pool && pool->gen_ctrs);
  1850. SOKOL_ASSERT((slot_index > _SIMGUI_INVALID_SLOT_INDEX) && (slot_index < pool->size));
  1851. SOKOL_ASSERT((slot->state == _SIMGUI_RESOURCESTATE_INITIAL) && (slot->id == SIMGUI_INVALID_ID));
  1852. uint32_t ctr = ++pool->gen_ctrs[slot_index];
  1853. slot->id = (ctr<<_SIMGUI_SLOT_SHIFT)|(slot_index & _SIMGUI_SLOT_MASK);
  1854. slot->state = _SIMGUI_RESOURCESTATE_ALLOC;
  1855. return slot->id;
  1856. }
  1857. // extract slot index from id
  1858. static int _simgui_slot_index(uint32_t id) {
  1859. int slot_index = (int) (id & _SIMGUI_SLOT_MASK);
  1860. SOKOL_ASSERT(_SIMGUI_INVALID_SLOT_INDEX != slot_index);
  1861. return slot_index;
  1862. }
  1863. static void _simgui_init_item_pool(_simgui_pool_t* pool, int pool_size, void** items_ptr, size_t item_size_bytes) {
  1864. // NOTE: the pools will have an additional item, since slot 0 is reserved
  1865. SOKOL_ASSERT(pool && (pool->size == 0));
  1866. SOKOL_ASSERT((pool_size > 0) && (pool_size < _SIMGUI_MAX_POOL_SIZE));
  1867. SOKOL_ASSERT(items_ptr && (*items_ptr == 0));
  1868. SOKOL_ASSERT(item_size_bytes > 0);
  1869. _simgui_init_pool(pool, pool_size);
  1870. const size_t pool_size_bytes = item_size_bytes * (size_t)pool->size;
  1871. *items_ptr = _simgui_malloc_clear(pool_size_bytes);
  1872. }
  1873. static void _simgui_discard_item_pool(_simgui_pool_t* pool, void** items_ptr) {
  1874. SOKOL_ASSERT(pool && (pool->size != 0));
  1875. SOKOL_ASSERT(items_ptr && (*items_ptr != 0));
  1876. _simgui_free(*items_ptr); *items_ptr = 0;
  1877. _simgui_discard_pool(pool);
  1878. }
  1879. static void _simgui_setup_image_pool(int pool_size) {
  1880. _simgui_image_pool_t* p = &_simgui.image_pool;
  1881. _simgui_init_item_pool(&p->pool, pool_size, (void**)&p->items, sizeof(_simgui_image_t));
  1882. }
  1883. static void _simgui_discard_image_pool(void) {
  1884. _simgui_image_pool_t* p = &_simgui.image_pool;
  1885. _simgui_discard_item_pool(&p->pool, (void**)&p->items);
  1886. }
  1887. static simgui_image_t _simgui_make_image_handle(uint32_t id) {
  1888. simgui_image_t handle = { id };
  1889. return handle;
  1890. }
  1891. static _simgui_image_t* _simgui_image_at(uint32_t id) {
  1892. SOKOL_ASSERT(SIMGUI_INVALID_ID != id);
  1893. const _simgui_image_pool_t* p = &_simgui.image_pool;
  1894. int slot_index = _simgui_slot_index(id);
  1895. SOKOL_ASSERT((slot_index > _SIMGUI_INVALID_SLOT_INDEX) && (slot_index < p->pool.size));
  1896. return &p->items[slot_index];
  1897. }
  1898. static _simgui_image_t* _simgui_lookup_image(uint32_t id) {
  1899. if (SIMGUI_INVALID_ID != id) {
  1900. _simgui_image_t* img = _simgui_image_at(id);
  1901. if (img->slot.id == id) {
  1902. return img;
  1903. }
  1904. }
  1905. return 0;
  1906. }
  1907. static simgui_image_t _simgui_alloc_image(void) {
  1908. _simgui_image_pool_t* p = &_simgui.image_pool;
  1909. int slot_index = _simgui_pool_alloc_index(&p->pool);
  1910. if (_SIMGUI_INVALID_SLOT_INDEX != slot_index) {
  1911. uint32_t id = _simgui_slot_init(&p->pool, &p->items[slot_index].slot, slot_index);
  1912. return _simgui_make_image_handle(id);
  1913. } else {
  1914. // pool exhausted
  1915. return _simgui_make_image_handle(SIMGUI_INVALID_ID);
  1916. }
  1917. }
  1918. static _simgui_resource_state _simgui_init_image(_simgui_image_t* img, const simgui_image_desc_t* desc) {
  1919. SOKOL_ASSERT(img && (img->slot.state == _SIMGUI_RESOURCESTATE_ALLOC));
  1920. SOKOL_ASSERT(desc);
  1921. SOKOL_ASSERT(_simgui.def_pip.id != SIMGUI_INVALID_ID);
  1922. SOKOL_ASSERT(_simgui.pip_unfilterable.id != SIMGUI_INVALID_ID);
  1923. img->image = desc->image;
  1924. img->sampler = desc->sampler;
  1925. if (sg_query_pixelformat(sg_query_image_desc(desc->image).pixel_format).filter) {
  1926. img->pip = _simgui.def_pip;
  1927. } else {
  1928. img->pip = _simgui.pip_unfilterable;
  1929. }
  1930. return _SIMGUI_RESOURCESTATE_VALID;
  1931. }
  1932. static void _simgui_deinit_image(_simgui_image_t* img) {
  1933. SOKOL_ASSERT(img);
  1934. img->image.id = SIMGUI_INVALID_ID;
  1935. img->sampler.id = SIMGUI_INVALID_ID;
  1936. img->pip.id = SIMGUI_INVALID_ID;
  1937. }
  1938. static void _simgui_destroy_image(simgui_image_t img_id) {
  1939. _simgui_image_t* img = _simgui_lookup_image(img_id.id);
  1940. if (img) {
  1941. _simgui_deinit_image(img);
  1942. _simgui_image_pool_t* p = &_simgui.image_pool;
  1943. _simgui_clear(img, sizeof(_simgui_image_t));
  1944. _simgui_pool_free_index(&p->pool, _simgui_slot_index(img_id.id));
  1945. }
  1946. }
  1947. static void _simgui_destroy_all_images(void) {
  1948. _simgui_image_pool_t* p = &_simgui.image_pool;
  1949. for (int i = 0; i < p->pool.size; i++) {
  1950. _simgui_image_t* img = &p->items[i];
  1951. _simgui_destroy_image(_simgui_make_image_handle(img->slot.id));
  1952. }
  1953. }
  1954. static simgui_image_desc_t _simgui_image_desc_defaults(const simgui_image_desc_t* desc) {
  1955. SOKOL_ASSERT(desc);
  1956. simgui_image_desc_t res = *desc;
  1957. res.image.id = _simgui_def(res.image.id, _simgui.def_img.id);
  1958. res.sampler.id = _simgui_def(res.sampler.id, _simgui.def_smp.id);
  1959. return res;
  1960. }
  1961. static bool _simgui_is_osx(void) {
  1962. #if defined(SOKOL_DUMMY_BACKEND)
  1963. return false;
  1964. #elif defined(__EMSCRIPTEN__)
  1965. return simgui_js_is_osx();
  1966. #elif defined(__APPLE__)
  1967. return true;
  1968. #else
  1969. return false;
  1970. #endif
  1971. }
  1972. static simgui_desc_t _simgui_desc_defaults(const simgui_desc_t* desc) {
  1973. SOKOL_ASSERT((desc->allocator.alloc_fn && desc->allocator.free_fn) || (!desc->allocator.alloc_fn && !desc->allocator.free_fn));
  1974. simgui_desc_t res = *desc;
  1975. res.max_vertices = _simgui_def(res.max_vertices, 65536);
  1976. res.image_pool_size = _simgui_def(res.image_pool_size, 256);
  1977. return res;
  1978. }
  1979. // ██████ ██ ██ ██████ ██ ██ ██████
  1980. // ██ ██ ██ ██ ██ ██ ██ ██ ██
  1981. // ██████ ██ ██ ██████ ██ ██ ██
  1982. // ██ ██ ██ ██ ██ ██ ██ ██
  1983. // ██ ██████ ██████ ███████ ██ ██████
  1984. //
  1985. // >>public
  1986. SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) {
  1987. SOKOL_ASSERT(desc);
  1988. _simgui_clear(&_simgui, sizeof(_simgui));
  1989. _simgui.init_cookie = _SIMGUI_INIT_COOKIE;
  1990. _simgui.desc = _simgui_desc_defaults(desc);
  1991. _simgui.cur_dpi_scale = 1.0f;
  1992. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  1993. _simgui.is_osx = _simgui_is_osx();
  1994. #endif
  1995. // can keep color_format, depth_format and sample_count as is,
  1996. // since sokol_gfx.h will do its own default-value handling
  1997. // setup image pool
  1998. _simgui_setup_image_pool(_simgui.desc.image_pool_size);
  1999. // allocate an intermediate vertex- and index-buffer
  2000. SOKOL_ASSERT(_simgui.desc.max_vertices > 0);
  2001. _simgui.vertices.size = (size_t)_simgui.desc.max_vertices * sizeof(ImDrawVert);
  2002. _simgui.vertices.ptr = _simgui_malloc(_simgui.vertices.size);
  2003. _simgui.indices.size = (size_t)_simgui.desc.max_vertices * 3 * sizeof(ImDrawIdx);
  2004. _simgui.indices.ptr = _simgui_malloc(_simgui.indices.size);
  2005. // initialize Dear ImGui
  2006. #if defined(__cplusplus)
  2007. ImGui::CreateContext();
  2008. ImGui::StyleColorsDark();
  2009. ImGuiIO* io = &ImGui::GetIO();
  2010. if (!_simgui.desc.no_default_font) {
  2011. io->Fonts->AddFontDefault();
  2012. }
  2013. #else
  2014. igCreateContext(NULL);
  2015. igStyleColorsDark(igGetStyle());
  2016. ImGuiIO* io = igGetIO();
  2017. if (!_simgui.desc.no_default_font) {
  2018. ImFontAtlas_AddFontDefault(io->Fonts, NULL);
  2019. }
  2020. #endif
  2021. io->IniFilename = _simgui.desc.ini_filename;
  2022. io->ConfigMacOSXBehaviors = _simgui_is_osx();
  2023. io->BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
  2024. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  2025. if (!_simgui.desc.disable_set_mouse_cursor) {
  2026. io->BackendFlags |= ImGuiBackendFlags_HasMouseCursors;
  2027. }
  2028. io->SetClipboardTextFn = _simgui_set_clipboard;
  2029. io->GetClipboardTextFn = _simgui_get_clipboard;
  2030. #endif
  2031. io->ConfigWindowsResizeFromEdges = !_simgui.desc.disable_windows_resize_from_edges;
  2032. // create sokol-gfx resources
  2033. sg_push_debug_group("sokol-imgui");
  2034. // shader object for using the embedded shader source (or bytecode)
  2035. sg_shader_desc shd_desc;
  2036. _simgui_clear(&shd_desc, sizeof(shd_desc));
  2037. shd_desc.attrs[0].name = "position";
  2038. shd_desc.attrs[1].name = "texcoord0";
  2039. shd_desc.attrs[2].name = "color0";
  2040. shd_desc.attrs[0].sem_name = "TEXCOORD";
  2041. shd_desc.attrs[0].sem_index = 0;
  2042. shd_desc.attrs[1].sem_name = "TEXCOORD";
  2043. shd_desc.attrs[1].sem_index = 1;
  2044. shd_desc.attrs[2].sem_name = "TEXCOORD";
  2045. shd_desc.attrs[2].sem_index = 2;
  2046. sg_shader_uniform_block_desc* ub = &shd_desc.vs.uniform_blocks[0];
  2047. ub->size = sizeof(_simgui_vs_params_t);
  2048. ub->uniforms[0].name = "vs_params";
  2049. ub->uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
  2050. ub->uniforms[0].array_count = 1;
  2051. shd_desc.fs.images[0].used = true;
  2052. shd_desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
  2053. shd_desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT;
  2054. shd_desc.fs.samplers[0].used = true;
  2055. shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
  2056. shd_desc.fs.image_sampler_pairs[0].used = true;
  2057. shd_desc.fs.image_sampler_pairs[0].image_slot = 0;
  2058. shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
  2059. shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
  2060. shd_desc.label = "sokol-imgui-shader";
  2061. #if defined(SOKOL_GLCORE33)
  2062. shd_desc.vs.source = _simgui_vs_source_glsl330;
  2063. shd_desc.fs.source = _simgui_fs_source_glsl330;
  2064. #elif defined(SOKOL_GLES3)
  2065. shd_desc.vs.source = _simgui_vs_source_glsl300es;
  2066. shd_desc.fs.source = _simgui_fs_source_glsl300es;
  2067. #elif defined(SOKOL_METAL)
  2068. shd_desc.vs.entry = "main0";
  2069. shd_desc.fs.entry = "main0";
  2070. switch (sg_query_backend()) {
  2071. case SG_BACKEND_METAL_MACOS:
  2072. shd_desc.vs.bytecode = SG_RANGE(_simgui_vs_bytecode_metal_macos);
  2073. shd_desc.fs.bytecode = SG_RANGE(_simgui_fs_bytecode_metal_macos);
  2074. break;
  2075. case SG_BACKEND_METAL_IOS:
  2076. shd_desc.vs.bytecode = SG_RANGE(_simgui_vs_bytecode_metal_ios);
  2077. shd_desc.fs.bytecode = SG_RANGE(_simgui_fs_bytecode_metal_ios);
  2078. break;
  2079. default:
  2080. shd_desc.vs.source = _simgui_vs_source_metal_sim;
  2081. shd_desc.fs.source = _simgui_fs_source_metal_sim;
  2082. break;
  2083. }
  2084. #elif defined(SOKOL_D3D11)
  2085. shd_desc.vs.bytecode = SG_RANGE(_simgui_vs_bytecode_hlsl4);
  2086. shd_desc.fs.bytecode = SG_RANGE(_simgui_fs_bytecode_hlsl4);
  2087. #elif defined(SOKOL_WGPU)
  2088. shd_desc.vs.source = _simgui_vs_source_wgsl;
  2089. shd_desc.fs.source = _simgui_fs_source_wgsl;
  2090. #else
  2091. shd_desc.vs.source = _simgui_vs_source_dummy;
  2092. shd_desc.fs.source = _simgui_fs_source_dummy;
  2093. #endif
  2094. _simgui.def_shd = sg_make_shader(&shd_desc);
  2095. // pipeline object for imgui rendering
  2096. sg_pipeline_desc pip_desc;
  2097. _simgui_clear(&pip_desc, sizeof(pip_desc));
  2098. pip_desc.layout.buffers[0].stride = sizeof(ImDrawVert);
  2099. {
  2100. sg_vertex_attr_state* attr = &pip_desc.layout.attrs[0];
  2101. attr->offset = offsetof(ImDrawVert, pos);
  2102. attr->format = SG_VERTEXFORMAT_FLOAT2;
  2103. }
  2104. {
  2105. sg_vertex_attr_state* attr = &pip_desc.layout.attrs[1];
  2106. attr->offset = offsetof(ImDrawVert, uv);
  2107. attr->format = SG_VERTEXFORMAT_FLOAT2;
  2108. }
  2109. {
  2110. sg_vertex_attr_state* attr = &pip_desc.layout.attrs[2];
  2111. attr->offset = offsetof(ImDrawVert, col);
  2112. attr->format = SG_VERTEXFORMAT_UBYTE4N;
  2113. }
  2114. pip_desc.shader = _simgui.def_shd;
  2115. pip_desc.index_type = SG_INDEXTYPE_UINT16;
  2116. pip_desc.sample_count = _simgui.desc.sample_count;
  2117. pip_desc.depth.pixel_format = _simgui.desc.depth_format;
  2118. pip_desc.colors[0].pixel_format = _simgui.desc.color_format;
  2119. pip_desc.colors[0].write_mask = _simgui.desc.write_alpha_channel ? SG_COLORMASK_RGBA : SG_COLORMASK_RGB;
  2120. pip_desc.colors[0].blend.enabled = true;
  2121. pip_desc.colors[0].blend.src_factor_rgb = SG_BLENDFACTOR_SRC_ALPHA;
  2122. pip_desc.colors[0].blend.dst_factor_rgb = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
  2123. if (_simgui.desc.write_alpha_channel) {
  2124. pip_desc.colors[0].blend.src_factor_alpha = SG_BLENDFACTOR_ONE;
  2125. pip_desc.colors[0].blend.dst_factor_alpha = SG_BLENDFACTOR_ONE;
  2126. }
  2127. pip_desc.label = "sokol-imgui-pipeline";
  2128. _simgui.def_pip = sg_make_pipeline(&pip_desc);
  2129. // create a unfilterable/nonfiltering variants of the shader and pipeline
  2130. shd_desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_UNFILTERABLE_FLOAT;
  2131. shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_NONFILTERING;
  2132. shd_desc.label = "sokol-imgui-shader-unfilterable";
  2133. _simgui.shd_unfilterable = sg_make_shader(&shd_desc);
  2134. pip_desc.shader = _simgui.shd_unfilterable;
  2135. pip_desc.label = "sokol-imgui-pipeline-unfilterable";
  2136. _simgui.pip_unfilterable = sg_make_pipeline(&pip_desc);
  2137. // NOTE: since we're in C++ mode here we can't use C99 designated init
  2138. sg_buffer_desc vb_desc;
  2139. _simgui_clear(&vb_desc, sizeof(vb_desc));
  2140. vb_desc.usage = SG_USAGE_STREAM;
  2141. vb_desc.size = _simgui.vertices.size;
  2142. vb_desc.label = "sokol-imgui-vertices";
  2143. _simgui.vbuf = sg_make_buffer(&vb_desc);
  2144. sg_buffer_desc ib_desc;
  2145. _simgui_clear(&ib_desc, sizeof(ib_desc));
  2146. ib_desc.type = SG_BUFFERTYPE_INDEXBUFFER;
  2147. ib_desc.usage = SG_USAGE_STREAM;
  2148. ib_desc.size = _simgui.indices.size;
  2149. ib_desc.label = "sokol-imgui-indices";
  2150. _simgui.ibuf = sg_make_buffer(&ib_desc);
  2151. // a default user-image sampler
  2152. sg_sampler_desc def_sampler_desc;
  2153. _simgui_clear(&def_sampler_desc, sizeof(def_sampler_desc));
  2154. def_sampler_desc.min_filter = SG_FILTER_NEAREST;
  2155. def_sampler_desc.mag_filter = SG_FILTER_NEAREST;
  2156. def_sampler_desc.wrap_u = SG_WRAP_CLAMP_TO_EDGE;
  2157. def_sampler_desc.wrap_v = SG_WRAP_CLAMP_TO_EDGE;
  2158. def_sampler_desc.label = "sokol-imgui-default-sampler";
  2159. _simgui.def_smp = sg_make_sampler(&def_sampler_desc);
  2160. // a default user image
  2161. static uint32_t def_pixels[64];
  2162. memset(def_pixels, 0xFF, sizeof(def_pixels));
  2163. sg_image_desc def_image_desc;
  2164. _simgui_clear(&def_image_desc, sizeof(def_image_desc));
  2165. def_image_desc.width = 8;
  2166. def_image_desc.height = 8;
  2167. def_image_desc.pixel_format = SG_PIXELFORMAT_RGBA8;
  2168. def_image_desc.data.subimage[0][0].ptr = def_pixels;
  2169. def_image_desc.data.subimage[0][0].size = sizeof(def_pixels);
  2170. def_image_desc.label = "sokol-imgui-default-image";
  2171. _simgui.def_img = sg_make_image(&def_image_desc);
  2172. // default font texture
  2173. if (!_simgui.desc.no_default_font) {
  2174. simgui_font_tex_desc_t simgui_font_smp_desc;
  2175. _simgui_clear(&simgui_font_smp_desc, sizeof(simgui_font_smp_desc));
  2176. simgui_create_fonts_texture(&simgui_font_smp_desc);
  2177. }
  2178. sg_pop_debug_group();
  2179. }
  2180. SOKOL_API_IMPL void simgui_create_fonts_texture(const simgui_font_tex_desc_t* desc) {
  2181. SOKOL_ASSERT(desc);
  2182. SOKOL_ASSERT(SG_INVALID_ID == _simgui.font_smp.id);
  2183. SOKOL_ASSERT(SG_INVALID_ID == _simgui.font_img.id);
  2184. SOKOL_ASSERT(SIMGUI_INVALID_ID == _simgui.default_font.id);
  2185. #if defined(__cplusplus)
  2186. ImGuiIO* io = &ImGui::GetIO();
  2187. #else
  2188. ImGuiIO* io = igGetIO();
  2189. #endif
  2190. // a default font sampler
  2191. sg_sampler_desc font_smp_desc;
  2192. _simgui_clear(&font_smp_desc, sizeof(font_smp_desc));
  2193. font_smp_desc.wrap_u = SG_WRAP_CLAMP_TO_EDGE;
  2194. font_smp_desc.wrap_v = SG_WRAP_CLAMP_TO_EDGE;
  2195. font_smp_desc.min_filter = desc->min_filter;
  2196. font_smp_desc.mag_filter = desc->mag_filter;
  2197. font_smp_desc.mipmap_filter = SG_FILTER_NONE;
  2198. font_smp_desc.label = "sokol-imgui-font-sampler";
  2199. _simgui.font_smp = sg_make_sampler(&font_smp_desc);
  2200. unsigned char* font_pixels;
  2201. int font_width, font_height;
  2202. #if defined(__cplusplus)
  2203. io->Fonts->GetTexDataAsRGBA32(&font_pixels, &font_width, &font_height);
  2204. #else
  2205. int bytes_per_pixel;
  2206. ImFontAtlas_GetTexDataAsRGBA32(io->Fonts, &font_pixels, &font_width, &font_height, &bytes_per_pixel);
  2207. #endif
  2208. sg_image_desc font_img_desc;
  2209. _simgui_clear(&font_img_desc, sizeof(font_img_desc));
  2210. font_img_desc.width = font_width;
  2211. font_img_desc.height = font_height;
  2212. font_img_desc.pixel_format = SG_PIXELFORMAT_RGBA8;
  2213. font_img_desc.data.subimage[0][0].ptr = font_pixels;
  2214. font_img_desc.data.subimage[0][0].size = (size_t)(font_width * font_height) * sizeof(uint32_t);
  2215. font_img_desc.label = "sokol-imgui-font-image";
  2216. _simgui.font_img = sg_make_image(&font_img_desc);
  2217. simgui_image_desc_t img_desc;
  2218. _simgui_clear(&img_desc, sizeof(img_desc));
  2219. img_desc.image = _simgui.font_img;
  2220. img_desc.sampler = _simgui.font_smp;
  2221. _simgui.default_font = simgui_make_image(&img_desc);
  2222. io->Fonts->TexID = simgui_imtextureid(_simgui.default_font);
  2223. }
  2224. SOKOL_API_IMPL void simgui_destroy_fonts_texture(void) {
  2225. // NOTE: it's valid to call the destroy funcs with SG_INVALID_ID
  2226. sg_destroy_sampler(_simgui.font_smp);
  2227. sg_destroy_image(_simgui.font_img);
  2228. simgui_destroy_image(_simgui.default_font);
  2229. _simgui.font_smp.id = SG_INVALID_ID;
  2230. _simgui.font_img.id = SG_INVALID_ID;
  2231. _simgui.default_font.id = SIMGUI_INVALID_ID;
  2232. }
  2233. SOKOL_API_IMPL void simgui_shutdown(void) {
  2234. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2235. #if defined(__cplusplus)
  2236. ImGui::DestroyContext();
  2237. #else
  2238. igDestroyContext(0);
  2239. #endif
  2240. // NOTE: it's valid to call the destroy funcs with SG_INVALID_ID
  2241. sg_destroy_pipeline(_simgui.pip_unfilterable);
  2242. sg_destroy_shader(_simgui.shd_unfilterable);
  2243. sg_destroy_pipeline(_simgui.def_pip);
  2244. sg_destroy_shader(_simgui.def_shd);
  2245. sg_destroy_sampler(_simgui.font_smp);
  2246. sg_destroy_image(_simgui.font_img);
  2247. sg_destroy_sampler(_simgui.def_smp);
  2248. sg_destroy_image(_simgui.def_img);
  2249. sg_destroy_buffer(_simgui.ibuf);
  2250. sg_destroy_buffer(_simgui.vbuf);
  2251. sg_pop_debug_group();
  2252. sg_push_debug_group("sokol-imgui");
  2253. _simgui_destroy_all_images();
  2254. _simgui_discard_image_pool();
  2255. SOKOL_ASSERT(_simgui.vertices.ptr);
  2256. _simgui_free((void*)_simgui.vertices.ptr);
  2257. SOKOL_ASSERT(_simgui.indices.ptr);
  2258. _simgui_free((void*)_simgui.indices.ptr);
  2259. _simgui.init_cookie = 0;
  2260. }
  2261. SOKOL_API_IMPL simgui_image_t simgui_make_image(const simgui_image_desc_t* desc) {
  2262. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2263. SOKOL_ASSERT(desc);
  2264. const simgui_image_desc_t desc_def = _simgui_image_desc_defaults(desc);
  2265. simgui_image_t img_id = _simgui_alloc_image();
  2266. _simgui_image_t* img = _simgui_lookup_image(img_id.id);
  2267. if (img) {
  2268. img->slot.state = _simgui_init_image(img, &desc_def);
  2269. SOKOL_ASSERT((img->slot.state == _SIMGUI_RESOURCESTATE_VALID) || (img->slot.state == _SIMGUI_RESOURCESTATE_FAILED));
  2270. } else {
  2271. _SIMGUI_ERROR(IMAGE_POOL_EXHAUSTED);
  2272. }
  2273. return img_id;
  2274. }
  2275. SOKOL_API_IMPL void simgui_destroy_image(simgui_image_t img_id) {
  2276. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2277. _simgui_destroy_image(img_id);
  2278. }
  2279. SOKOL_API_IMPL simgui_image_desc_t simgui_query_image_desc(simgui_image_t img_id) {
  2280. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2281. _simgui_image_t* img = _simgui_lookup_image(img_id.id);
  2282. simgui_image_desc_t desc;
  2283. _simgui_clear(&desc, sizeof(desc));
  2284. if (img) {
  2285. desc.image = img->image;
  2286. desc.sampler = img->sampler;
  2287. }
  2288. return desc;
  2289. }
  2290. SOKOL_API_IMPL void* simgui_imtextureid(simgui_image_t img) {
  2291. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2292. return (void*)(uintptr_t)img.id;
  2293. }
  2294. SOKOL_API_IMPL simgui_image_t simgui_image_from_imtextureid(void* imtextureid) {
  2295. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2296. simgui_image_t img = { (uint32_t)(uintptr_t) imtextureid };
  2297. return img;
  2298. }
  2299. SOKOL_API_IMPL void simgui_new_frame(const simgui_frame_desc_t* desc) {
  2300. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2301. SOKOL_ASSERT(desc);
  2302. SOKOL_ASSERT(desc->width > 0);
  2303. SOKOL_ASSERT(desc->height > 0);
  2304. _simgui.cur_dpi_scale = _simgui_def(desc->dpi_scale, 1.0f);
  2305. #if defined(__cplusplus)
  2306. ImGuiIO* io = &ImGui::GetIO();
  2307. #else
  2308. ImGuiIO* io = igGetIO();
  2309. #endif
  2310. io->DisplaySize.x = ((float)desc->width) / _simgui.cur_dpi_scale;
  2311. io->DisplaySize.y = ((float)desc->height) / _simgui.cur_dpi_scale;
  2312. io->DeltaTime = (float)desc->delta_time;
  2313. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  2314. if (io->WantTextInput && !sapp_keyboard_shown()) {
  2315. sapp_show_keyboard(true);
  2316. }
  2317. if (!io->WantTextInput && sapp_keyboard_shown()) {
  2318. sapp_show_keyboard(false);
  2319. }
  2320. if (!_simgui.desc.disable_set_mouse_cursor) {
  2321. #if defined(__cplusplus)
  2322. ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
  2323. #else
  2324. ImGuiMouseCursor imgui_cursor = igGetMouseCursor();
  2325. #endif
  2326. sapp_mouse_cursor cursor = sapp_get_mouse_cursor();
  2327. switch (imgui_cursor) {
  2328. case ImGuiMouseCursor_Arrow: cursor = SAPP_MOUSECURSOR_ARROW; break;
  2329. case ImGuiMouseCursor_TextInput: cursor = SAPP_MOUSECURSOR_IBEAM; break;
  2330. case ImGuiMouseCursor_ResizeAll: cursor = SAPP_MOUSECURSOR_RESIZE_ALL; break;
  2331. case ImGuiMouseCursor_ResizeNS: cursor = SAPP_MOUSECURSOR_RESIZE_NS; break;
  2332. case ImGuiMouseCursor_ResizeEW: cursor = SAPP_MOUSECURSOR_RESIZE_EW; break;
  2333. case ImGuiMouseCursor_ResizeNESW: cursor = SAPP_MOUSECURSOR_RESIZE_NESW; break;
  2334. case ImGuiMouseCursor_ResizeNWSE: cursor = SAPP_MOUSECURSOR_RESIZE_NWSE; break;
  2335. case ImGuiMouseCursor_Hand: cursor = SAPP_MOUSECURSOR_POINTING_HAND; break;
  2336. case ImGuiMouseCursor_NotAllowed: cursor = SAPP_MOUSECURSOR_NOT_ALLOWED; break;
  2337. default: break;
  2338. }
  2339. sapp_set_mouse_cursor(cursor);
  2340. }
  2341. #endif
  2342. #if defined(__cplusplus)
  2343. ImGui::NewFrame();
  2344. #else
  2345. igNewFrame();
  2346. #endif
  2347. }
  2348. static const _simgui_image_t* _simgui_bind_image_sampler(sg_bindings* bindings, ImTextureID tex_id) {
  2349. const _simgui_image_t* img = _simgui_lookup_image((uint32_t)(uintptr_t)tex_id);
  2350. if (img) {
  2351. bindings->fs.images[0] = img->image;
  2352. bindings->fs.samplers[0] = img->sampler;
  2353. } else {
  2354. bindings->fs.images[0] = _simgui.def_img;
  2355. bindings->fs.samplers[0] = _simgui.def_smp;
  2356. }
  2357. return img;
  2358. }
  2359. static ImDrawList* _simgui_imdrawlist_at(ImDrawData* draw_data, int cl_index) {
  2360. #if defined(__cplusplus)
  2361. return draw_data->CmdLists[cl_index];
  2362. #else
  2363. return draw_data->CmdLists.Data[cl_index];
  2364. #endif
  2365. }
  2366. SOKOL_API_IMPL void simgui_render(void) {
  2367. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2368. #if defined(__cplusplus)
  2369. ImGui::Render();
  2370. ImDrawData* draw_data = ImGui::GetDrawData();
  2371. ImGuiIO* io = &ImGui::GetIO();
  2372. #else
  2373. igRender();
  2374. ImDrawData* draw_data = igGetDrawData();
  2375. ImGuiIO* io = igGetIO();
  2376. #endif
  2377. if (0 == draw_data) {
  2378. return;
  2379. }
  2380. if (draw_data->CmdListsCount == 0) {
  2381. return;
  2382. }
  2383. /* copy vertices and indices into an intermediate buffer so that
  2384. they can be updated with a single sg_update_buffer() call each
  2385. (sg_append_buffer() has performance problems on some GL platforms),
  2386. also keep track of valid number of command lists in case of a
  2387. buffer overflow
  2388. */
  2389. size_t all_vtx_size = 0;
  2390. size_t all_idx_size = 0;
  2391. int cmd_list_count = 0;
  2392. for (int cl_index = 0; cl_index < draw_data->CmdListsCount; cl_index++, cmd_list_count++) {
  2393. ImDrawList* cl = _simgui_imdrawlist_at(draw_data, cl_index);
  2394. const size_t vtx_size = (size_t)cl->VtxBuffer.Size * sizeof(ImDrawVert);
  2395. const size_t idx_size = (size_t)cl->IdxBuffer.Size * sizeof(ImDrawIdx);
  2396. // check for buffer overflow
  2397. if (((all_vtx_size + vtx_size) > _simgui.vertices.size) ||
  2398. ((all_idx_size + idx_size) > _simgui.indices.size))
  2399. {
  2400. break;
  2401. }
  2402. // copy vertices and indices into common buffers
  2403. if (vtx_size > 0) {
  2404. const ImDrawVert* src_vtx_ptr = cl->VtxBuffer.Data;
  2405. void* dst_vtx_ptr = (void*) (((uint8_t*)_simgui.vertices.ptr) + all_vtx_size);
  2406. memcpy(dst_vtx_ptr, src_vtx_ptr, vtx_size);
  2407. }
  2408. if (idx_size > 0) {
  2409. const ImDrawIdx* src_idx_ptr = cl->IdxBuffer.Data;
  2410. void* dst_idx_ptr = (void*) (((uint8_t*)_simgui.indices.ptr) + all_idx_size);
  2411. memcpy(dst_idx_ptr, src_idx_ptr, idx_size);
  2412. }
  2413. all_vtx_size += vtx_size;
  2414. all_idx_size += idx_size;
  2415. }
  2416. if (0 == cmd_list_count) {
  2417. return;
  2418. }
  2419. // update the sokol-gfx vertex- and index-buffer
  2420. sg_push_debug_group("sokol-imgui");
  2421. if (all_vtx_size > 0) {
  2422. sg_range vtx_data = _simgui.vertices;
  2423. vtx_data.size = all_vtx_size;
  2424. sg_update_buffer(_simgui.vbuf, &vtx_data);
  2425. }
  2426. if (all_idx_size > 0) {
  2427. sg_range idx_data = _simgui.indices;
  2428. idx_data.size = all_idx_size;
  2429. sg_update_buffer(_simgui.ibuf, &idx_data);
  2430. }
  2431. // render the ImGui command list
  2432. const float dpi_scale = _simgui.cur_dpi_scale;
  2433. const int fb_width = (int) (io->DisplaySize.x * dpi_scale);
  2434. const int fb_height = (int) (io->DisplaySize.y * dpi_scale);
  2435. sg_apply_viewport(0, 0, fb_width, fb_height, true);
  2436. sg_apply_scissor_rect(0, 0, fb_width, fb_height, true);
  2437. sg_apply_pipeline(_simgui.def_pip);
  2438. _simgui_vs_params_t vs_params;
  2439. _simgui_clear((void*)&vs_params, sizeof(vs_params));
  2440. vs_params.disp_size.x = io->DisplaySize.x;
  2441. vs_params.disp_size.y = io->DisplaySize.y;
  2442. sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, SG_RANGE_REF(vs_params));
  2443. sg_bindings bind;
  2444. _simgui_clear((void*)&bind, sizeof(bind));
  2445. bind.vertex_buffers[0] = _simgui.vbuf;
  2446. bind.index_buffer = _simgui.ibuf;
  2447. ImTextureID tex_id = io->Fonts->TexID;
  2448. _simgui_bind_image_sampler(&bind, tex_id);
  2449. int vb_offset = 0;
  2450. int ib_offset = 0;
  2451. for (int cl_index = 0; cl_index < cmd_list_count; cl_index++) {
  2452. ImDrawList* cl = _simgui_imdrawlist_at(draw_data, cl_index);
  2453. bind.vertex_buffer_offsets[0] = vb_offset;
  2454. bind.index_buffer_offset = ib_offset;
  2455. sg_apply_bindings(&bind);
  2456. #if defined(__cplusplus)
  2457. const int num_cmds = cl->CmdBuffer.size();
  2458. #else
  2459. const int num_cmds = cl->CmdBuffer.Size;
  2460. #endif
  2461. uint32_t vtx_offset = 0;
  2462. for (int cmd_index = 0; cmd_index < num_cmds; cmd_index++) {
  2463. ImDrawCmd* pcmd = &cl->CmdBuffer.Data[cmd_index];
  2464. if (pcmd->UserCallback != 0) {
  2465. // User callback, registered via ImDrawList::AddCallback()
  2466. // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
  2467. if (pcmd->UserCallback != ImDrawCallback_ResetRenderState) {
  2468. pcmd->UserCallback(cl, pcmd);
  2469. // need to re-apply all state after calling a user callback
  2470. sg_reset_state_cache();
  2471. sg_apply_viewport(0, 0, fb_width, fb_height, true);
  2472. sg_apply_pipeline(_simgui.def_pip);
  2473. sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, SG_RANGE_REF(vs_params));
  2474. sg_apply_bindings(&bind);
  2475. }
  2476. } else {
  2477. if ((tex_id != pcmd->TextureId) || (vtx_offset != pcmd->VtxOffset)) {
  2478. tex_id = pcmd->TextureId;
  2479. vtx_offset = pcmd->VtxOffset;
  2480. const _simgui_image_t* img = _simgui_bind_image_sampler(&bind, tex_id);
  2481. if (img) {
  2482. sg_apply_pipeline(img->pip);
  2483. } else {
  2484. sg_apply_pipeline(_simgui.def_pip);
  2485. }
  2486. sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, SG_RANGE_REF(vs_params));
  2487. bind.vertex_buffer_offsets[0] = vb_offset + (int)(pcmd->VtxOffset * sizeof(ImDrawVert));
  2488. sg_apply_bindings(&bind);
  2489. }
  2490. const int scissor_x = (int) (pcmd->ClipRect.x * dpi_scale);
  2491. const int scissor_y = (int) (pcmd->ClipRect.y * dpi_scale);
  2492. const int scissor_w = (int) ((pcmd->ClipRect.z - pcmd->ClipRect.x) * dpi_scale);
  2493. const int scissor_h = (int) ((pcmd->ClipRect.w - pcmd->ClipRect.y) * dpi_scale);
  2494. sg_apply_scissor_rect(scissor_x, scissor_y, scissor_w, scissor_h, true);
  2495. sg_draw((int)pcmd->IdxOffset, (int)pcmd->ElemCount, 1);
  2496. }
  2497. }
  2498. #if defined(__cplusplus)
  2499. const size_t vtx_size = (size_t)cl->VtxBuffer.size() * sizeof(ImDrawVert);
  2500. const size_t idx_size = (size_t)cl->IdxBuffer.size() * sizeof(ImDrawIdx);
  2501. #else
  2502. const size_t vtx_size = (size_t)cl->VtxBuffer.Size * sizeof(ImDrawVert);
  2503. const size_t idx_size = (size_t)cl->IdxBuffer.Size * sizeof(ImDrawIdx);
  2504. #endif
  2505. vb_offset += (int)vtx_size;
  2506. ib_offset += (int)idx_size;
  2507. }
  2508. sg_apply_viewport(0, 0, fb_width, fb_height, true);
  2509. sg_apply_scissor_rect(0, 0, fb_width, fb_height, true);
  2510. sg_pop_debug_group();
  2511. }
  2512. SOKOL_API_IMPL void simgui_add_focus_event(bool focus) {
  2513. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2514. #if defined(__cplusplus)
  2515. ImGuiIO* io = &ImGui::GetIO();
  2516. io->AddFocusEvent(focus);
  2517. #else
  2518. ImGuiIO* io = igGetIO();
  2519. ImGuiIO_AddFocusEvent(io, focus);
  2520. #endif
  2521. }
  2522. SOKOL_API_IMPL void simgui_add_mouse_pos_event(float x, float y) {
  2523. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2524. #if defined(__cplusplus)
  2525. ImGuiIO* io = &ImGui::GetIO();
  2526. #if (IMGUI_VERSION_NUM >= 18950)
  2527. io->AddMouseSourceEvent(ImGuiMouseSource_Mouse);
  2528. #endif
  2529. io->AddMousePosEvent(x, y);
  2530. #else
  2531. ImGuiIO* io = igGetIO();
  2532. #if (IMGUI_VERSION_NUM >= 18950)
  2533. ImGuiIO_AddMouseSourceEvent(io, ImGuiMouseSource_Mouse);
  2534. #endif
  2535. ImGuiIO_AddMousePosEvent(io, x, y);
  2536. #endif
  2537. }
  2538. SOKOL_API_IMPL void simgui_add_touch_pos_event(float x, float y) {
  2539. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2540. #if defined(__cplusplus)
  2541. ImGuiIO* io = &ImGui::GetIO();
  2542. #if (IMGUI_VERSION_NUM >= 18950)
  2543. io->AddMouseSourceEvent(ImGuiMouseSource_TouchScreen);
  2544. #endif
  2545. io->AddMousePosEvent(x, y);
  2546. #else
  2547. ImGuiIO* io = igGetIO();
  2548. #if (IMGUI_VERSION_NUM >= 18950)
  2549. ImGuiIO_AddMouseSourceEvent(io, ImGuiMouseSource_TouchScreen);
  2550. #endif
  2551. ImGuiIO_AddMousePosEvent(io, x, y);
  2552. #endif
  2553. }
  2554. SOKOL_API_IMPL void simgui_add_mouse_button_event(int mouse_button, bool down) {
  2555. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2556. #if defined(__cplusplus)
  2557. ImGuiIO* io = &ImGui::GetIO();
  2558. #if (IMGUI_VERSION_NUM >= 18950)
  2559. io->AddMouseSourceEvent(ImGuiMouseSource_Mouse);
  2560. #endif
  2561. io->AddMouseButtonEvent(mouse_button, down);
  2562. #else
  2563. ImGuiIO* io = igGetIO();
  2564. #if (IMGUI_VERSION_NUM >= 18950)
  2565. ImGuiIO_AddMouseSourceEvent(io, ImGuiMouseSource_Mouse);
  2566. #endif
  2567. ImGuiIO_AddMouseButtonEvent(io, mouse_button, down);
  2568. #endif
  2569. }
  2570. SOKOL_API_IMPL void simgui_add_touch_button_event(int mouse_button, bool down) {
  2571. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2572. #if defined(__cplusplus)
  2573. ImGuiIO* io = &ImGui::GetIO();
  2574. #if (IMGUI_VERSION_NUM >= 18950)
  2575. io->AddMouseSourceEvent(ImGuiMouseSource_TouchScreen);
  2576. #endif
  2577. io->AddMouseButtonEvent(mouse_button, down);
  2578. #else
  2579. ImGuiIO* io = igGetIO();
  2580. #if (IMGUI_VERSION_NUM >= 18950)
  2581. ImGuiIO_AddMouseSourceEvent(io, ImGuiMouseSource_TouchScreen);
  2582. #endif
  2583. ImGuiIO_AddMouseButtonEvent(io, mouse_button, down);
  2584. #endif
  2585. }
  2586. SOKOL_API_IMPL void simgui_add_mouse_wheel_event(float wheel_x, float wheel_y) {
  2587. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2588. #if defined(__cplusplus)
  2589. ImGuiIO* io = &ImGui::GetIO();
  2590. #if (IMGUI_VERSION_NUM >= 18950)
  2591. io->AddMouseSourceEvent(ImGuiMouseSource_Mouse);
  2592. #endif
  2593. io->AddMouseWheelEvent(wheel_x, wheel_y);
  2594. #else
  2595. ImGuiIO* io = igGetIO();
  2596. #if (IMGUI_VERSION_NUM >= 18950)
  2597. ImGuiIO_AddMouseSourceEvent(io, ImGuiMouseSource_Mouse);
  2598. #endif
  2599. ImGuiIO_AddMouseWheelEvent(io, wheel_x, wheel_y);
  2600. #endif
  2601. }
  2602. SOKOL_API_IMPL void simgui_add_key_event(int (*map_keycode)(int), int keycode, bool down) {
  2603. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2604. const ImGuiKey imgui_key = (ImGuiKey)map_keycode(keycode);
  2605. #if defined(__cplusplus)
  2606. ImGuiIO* io = &ImGui::GetIO();
  2607. io->AddKeyEvent(imgui_key, down);
  2608. io->SetKeyEventNativeData(imgui_key, keycode, 0, -1);
  2609. #else
  2610. ImGuiIO* io = igGetIO();
  2611. ImGuiIO_AddKeyEvent(io, imgui_key, down);
  2612. ImGuiIO_SetKeyEventNativeData(io, imgui_key, keycode, 0, -1);
  2613. #endif
  2614. }
  2615. SOKOL_API_IMPL void simgui_add_input_character(uint32_t c) {
  2616. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2617. #if defined(__cplusplus)
  2618. ImGuiIO* io = &ImGui::GetIO();
  2619. io->AddInputCharacter(c);
  2620. #else
  2621. ImGuiIO* io = igGetIO();
  2622. ImGuiIO_AddInputCharacter(io, c);
  2623. #endif
  2624. }
  2625. SOKOL_API_IMPL void simgui_add_input_characters_utf8(const char* c) {
  2626. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2627. #if defined(__cplusplus)
  2628. ImGuiIO* io = &ImGui::GetIO();
  2629. io->AddInputCharactersUTF8(c);
  2630. #else
  2631. ImGuiIO* io = igGetIO();
  2632. ImGuiIO_AddInputCharactersUTF8(io, c);
  2633. #endif
  2634. }
  2635. #if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
  2636. _SOKOL_PRIVATE bool _simgui_is_ctrl(uint32_t modifiers) {
  2637. if (_simgui.is_osx) {
  2638. return 0 != (modifiers & SAPP_MODIFIER_SUPER);
  2639. } else {
  2640. return 0 != (modifiers & SAPP_MODIFIER_CTRL);
  2641. }
  2642. }
  2643. _SOKOL_PRIVATE ImGuiKey _simgui_map_keycode(sapp_keycode key) {
  2644. switch (key) {
  2645. case SAPP_KEYCODE_SPACE: return ImGuiKey_Space;
  2646. case SAPP_KEYCODE_APOSTROPHE: return ImGuiKey_Apostrophe;
  2647. case SAPP_KEYCODE_COMMA: return ImGuiKey_Comma;
  2648. case SAPP_KEYCODE_MINUS: return ImGuiKey_Minus;
  2649. case SAPP_KEYCODE_PERIOD: return ImGuiKey_Apostrophe;
  2650. case SAPP_KEYCODE_SLASH: return ImGuiKey_Slash;
  2651. case SAPP_KEYCODE_0: return ImGuiKey_0;
  2652. case SAPP_KEYCODE_1: return ImGuiKey_1;
  2653. case SAPP_KEYCODE_2: return ImGuiKey_2;
  2654. case SAPP_KEYCODE_3: return ImGuiKey_3;
  2655. case SAPP_KEYCODE_4: return ImGuiKey_4;
  2656. case SAPP_KEYCODE_5: return ImGuiKey_5;
  2657. case SAPP_KEYCODE_6: return ImGuiKey_6;
  2658. case SAPP_KEYCODE_7: return ImGuiKey_7;
  2659. case SAPP_KEYCODE_8: return ImGuiKey_8;
  2660. case SAPP_KEYCODE_9: return ImGuiKey_9;
  2661. case SAPP_KEYCODE_SEMICOLON: return ImGuiKey_Semicolon;
  2662. case SAPP_KEYCODE_EQUAL: return ImGuiKey_Equal;
  2663. case SAPP_KEYCODE_A: return ImGuiKey_A;
  2664. case SAPP_KEYCODE_B: return ImGuiKey_B;
  2665. case SAPP_KEYCODE_C: return ImGuiKey_C;
  2666. case SAPP_KEYCODE_D: return ImGuiKey_D;
  2667. case SAPP_KEYCODE_E: return ImGuiKey_E;
  2668. case SAPP_KEYCODE_F: return ImGuiKey_F;
  2669. case SAPP_KEYCODE_G: return ImGuiKey_G;
  2670. case SAPP_KEYCODE_H: return ImGuiKey_H;
  2671. case SAPP_KEYCODE_I: return ImGuiKey_I;
  2672. case SAPP_KEYCODE_J: return ImGuiKey_J;
  2673. case SAPP_KEYCODE_K: return ImGuiKey_K;
  2674. case SAPP_KEYCODE_L: return ImGuiKey_L;
  2675. case SAPP_KEYCODE_M: return ImGuiKey_M;
  2676. case SAPP_KEYCODE_N: return ImGuiKey_N;
  2677. case SAPP_KEYCODE_O: return ImGuiKey_O;
  2678. case SAPP_KEYCODE_P: return ImGuiKey_P;
  2679. case SAPP_KEYCODE_Q: return ImGuiKey_Q;
  2680. case SAPP_KEYCODE_R: return ImGuiKey_R;
  2681. case SAPP_KEYCODE_S: return ImGuiKey_S;
  2682. case SAPP_KEYCODE_T: return ImGuiKey_T;
  2683. case SAPP_KEYCODE_U: return ImGuiKey_U;
  2684. case SAPP_KEYCODE_V: return ImGuiKey_V;
  2685. case SAPP_KEYCODE_W: return ImGuiKey_W;
  2686. case SAPP_KEYCODE_X: return ImGuiKey_X;
  2687. case SAPP_KEYCODE_Y: return ImGuiKey_Y;
  2688. case SAPP_KEYCODE_Z: return ImGuiKey_Z;
  2689. case SAPP_KEYCODE_LEFT_BRACKET: return ImGuiKey_LeftBracket;
  2690. case SAPP_KEYCODE_BACKSLASH: return ImGuiKey_Backslash;
  2691. case SAPP_KEYCODE_RIGHT_BRACKET:return ImGuiKey_RightBracket;
  2692. case SAPP_KEYCODE_GRAVE_ACCENT: return ImGuiKey_GraveAccent;
  2693. case SAPP_KEYCODE_ESCAPE: return ImGuiKey_Escape;
  2694. case SAPP_KEYCODE_ENTER: return ImGuiKey_Enter;
  2695. case SAPP_KEYCODE_TAB: return ImGuiKey_Tab;
  2696. case SAPP_KEYCODE_BACKSPACE: return ImGuiKey_Backspace;
  2697. case SAPP_KEYCODE_INSERT: return ImGuiKey_Insert;
  2698. case SAPP_KEYCODE_DELETE: return ImGuiKey_Delete;
  2699. case SAPP_KEYCODE_RIGHT: return ImGuiKey_RightArrow;
  2700. case SAPP_KEYCODE_LEFT: return ImGuiKey_LeftArrow;
  2701. case SAPP_KEYCODE_DOWN: return ImGuiKey_DownArrow;
  2702. case SAPP_KEYCODE_UP: return ImGuiKey_UpArrow;
  2703. case SAPP_KEYCODE_PAGE_UP: return ImGuiKey_PageUp;
  2704. case SAPP_KEYCODE_PAGE_DOWN: return ImGuiKey_PageDown;
  2705. case SAPP_KEYCODE_HOME: return ImGuiKey_Home;
  2706. case SAPP_KEYCODE_END: return ImGuiKey_End;
  2707. case SAPP_KEYCODE_CAPS_LOCK: return ImGuiKey_CapsLock;
  2708. case SAPP_KEYCODE_SCROLL_LOCK: return ImGuiKey_ScrollLock;
  2709. case SAPP_KEYCODE_NUM_LOCK: return ImGuiKey_NumLock;
  2710. case SAPP_KEYCODE_PRINT_SCREEN: return ImGuiKey_PrintScreen;
  2711. case SAPP_KEYCODE_PAUSE: return ImGuiKey_Pause;
  2712. case SAPP_KEYCODE_F1: return ImGuiKey_F1;
  2713. case SAPP_KEYCODE_F2: return ImGuiKey_F2;
  2714. case SAPP_KEYCODE_F3: return ImGuiKey_F3;
  2715. case SAPP_KEYCODE_F4: return ImGuiKey_F4;
  2716. case SAPP_KEYCODE_F5: return ImGuiKey_F5;
  2717. case SAPP_KEYCODE_F6: return ImGuiKey_F6;
  2718. case SAPP_KEYCODE_F7: return ImGuiKey_F7;
  2719. case SAPP_KEYCODE_F8: return ImGuiKey_F8;
  2720. case SAPP_KEYCODE_F9: return ImGuiKey_F9;
  2721. case SAPP_KEYCODE_F10: return ImGuiKey_F10;
  2722. case SAPP_KEYCODE_F11: return ImGuiKey_F11;
  2723. case SAPP_KEYCODE_F12: return ImGuiKey_F12;
  2724. case SAPP_KEYCODE_KP_0: return ImGuiKey_Keypad0;
  2725. case SAPP_KEYCODE_KP_1: return ImGuiKey_Keypad1;
  2726. case SAPP_KEYCODE_KP_2: return ImGuiKey_Keypad2;
  2727. case SAPP_KEYCODE_KP_3: return ImGuiKey_Keypad3;
  2728. case SAPP_KEYCODE_KP_4: return ImGuiKey_Keypad4;
  2729. case SAPP_KEYCODE_KP_5: return ImGuiKey_Keypad5;
  2730. case SAPP_KEYCODE_KP_6: return ImGuiKey_Keypad6;
  2731. case SAPP_KEYCODE_KP_7: return ImGuiKey_Keypad7;
  2732. case SAPP_KEYCODE_KP_8: return ImGuiKey_Keypad8;
  2733. case SAPP_KEYCODE_KP_9: return ImGuiKey_Keypad9;
  2734. case SAPP_KEYCODE_KP_DECIMAL: return ImGuiKey_KeypadDecimal;
  2735. case SAPP_KEYCODE_KP_DIVIDE: return ImGuiKey_KeypadDivide;
  2736. case SAPP_KEYCODE_KP_MULTIPLY: return ImGuiKey_KeypadMultiply;
  2737. case SAPP_KEYCODE_KP_SUBTRACT: return ImGuiKey_KeypadSubtract;
  2738. case SAPP_KEYCODE_KP_ADD: return ImGuiKey_KeypadAdd;
  2739. case SAPP_KEYCODE_KP_ENTER: return ImGuiKey_KeypadEnter;
  2740. case SAPP_KEYCODE_KP_EQUAL: return ImGuiKey_KeypadEqual;
  2741. case SAPP_KEYCODE_LEFT_SHIFT: return ImGuiKey_LeftShift;
  2742. case SAPP_KEYCODE_LEFT_CONTROL: return ImGuiKey_LeftCtrl;
  2743. case SAPP_KEYCODE_LEFT_ALT: return ImGuiKey_LeftAlt;
  2744. case SAPP_KEYCODE_LEFT_SUPER: return ImGuiKey_LeftSuper;
  2745. case SAPP_KEYCODE_RIGHT_SHIFT: return ImGuiKey_RightShift;
  2746. case SAPP_KEYCODE_RIGHT_CONTROL:return ImGuiKey_RightCtrl;
  2747. case SAPP_KEYCODE_RIGHT_ALT: return ImGuiKey_RightAlt;
  2748. case SAPP_KEYCODE_RIGHT_SUPER: return ImGuiKey_RightSuper;
  2749. case SAPP_KEYCODE_MENU: return ImGuiKey_Menu;
  2750. default: return ImGuiKey_None;
  2751. }
  2752. }
  2753. _SOKOL_PRIVATE void _simgui_add_sapp_key_event(ImGuiIO* io, sapp_keycode sapp_key, bool down) {
  2754. const ImGuiKey imgui_key = _simgui_map_keycode(sapp_key);
  2755. #if defined(__cplusplus)
  2756. io->AddKeyEvent(imgui_key, down);
  2757. io->SetKeyEventNativeData(imgui_key, (int)sapp_key, 0, -1);
  2758. #else
  2759. ImGuiIO_AddKeyEvent(io, imgui_key, down);
  2760. ImGuiIO_SetKeyEventNativeData(io, imgui_key, (int)sapp_key, 0, -1);
  2761. #endif
  2762. }
  2763. _SOKOL_PRIVATE void _simgui_add_imgui_key_event(ImGuiIO* io, ImGuiKey imgui_key, bool down) {
  2764. #if defined(__cplusplus)
  2765. io->AddKeyEvent(imgui_key, down);
  2766. #else
  2767. ImGuiIO_AddKeyEvent(io, imgui_key, down);
  2768. #endif
  2769. }
  2770. _SOKOL_PRIVATE void _simgui_update_modifiers(ImGuiIO* io, uint32_t mods) {
  2771. _simgui_add_imgui_key_event(io, ImGuiMod_Ctrl, (mods & SAPP_MODIFIER_CTRL) != 0);
  2772. _simgui_add_imgui_key_event(io, ImGuiMod_Shift, (mods & SAPP_MODIFIER_SHIFT) != 0);
  2773. _simgui_add_imgui_key_event(io, ImGuiMod_Alt, (mods & SAPP_MODIFIER_ALT) != 0);
  2774. _simgui_add_imgui_key_event(io, ImGuiMod_Super, (mods & SAPP_MODIFIER_SUPER) != 0);
  2775. }
  2776. // returns Ctrl or Super, depending on platform
  2777. _SOKOL_PRIVATE ImGuiKey _simgui_copypaste_modifier(void) {
  2778. return _simgui.is_osx ? ImGuiMod_Super : ImGuiMod_Ctrl;
  2779. }
  2780. SOKOL_API_IMPL int simgui_map_keycode(sapp_keycode keycode) {
  2781. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2782. return (int)_simgui_map_keycode(keycode);
  2783. }
  2784. SOKOL_API_IMPL bool simgui_handle_event(const sapp_event* ev) {
  2785. SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
  2786. const float dpi_scale = _simgui.cur_dpi_scale;
  2787. #if defined(__cplusplus)
  2788. ImGuiIO* io = &ImGui::GetIO();
  2789. #else
  2790. ImGuiIO* io = igGetIO();
  2791. #endif
  2792. switch (ev->type) {
  2793. case SAPP_EVENTTYPE_FOCUSED:
  2794. simgui_add_focus_event(true);
  2795. break;
  2796. case SAPP_EVENTTYPE_UNFOCUSED:
  2797. simgui_add_focus_event(false);
  2798. break;
  2799. case SAPP_EVENTTYPE_MOUSE_DOWN:
  2800. simgui_add_mouse_pos_event(ev->mouse_x / dpi_scale, ev->mouse_y / dpi_scale);
  2801. simgui_add_mouse_button_event((int)ev->mouse_button, true);
  2802. _simgui_update_modifiers(io, ev->modifiers);
  2803. break;
  2804. case SAPP_EVENTTYPE_MOUSE_UP:
  2805. simgui_add_mouse_pos_event(ev->mouse_x / dpi_scale, ev->mouse_y / dpi_scale);
  2806. simgui_add_mouse_button_event((int)ev->mouse_button, false);
  2807. _simgui_update_modifiers(io, ev->modifiers);
  2808. break;
  2809. case SAPP_EVENTTYPE_MOUSE_MOVE:
  2810. simgui_add_mouse_pos_event(ev->mouse_x / dpi_scale, ev->mouse_y / dpi_scale);
  2811. break;
  2812. case SAPP_EVENTTYPE_MOUSE_ENTER:
  2813. case SAPP_EVENTTYPE_MOUSE_LEAVE:
  2814. // FIXME: since the sokol_app.h emscripten backend doesn't support
  2815. // mouse capture, mouse buttons must be released when the mouse leaves the
  2816. // browser window, so that they don't "stick" when released outside the window.
  2817. // A cleaner solution would be a new sokol_app.h function to query
  2818. // "platform behaviour flags".
  2819. #if defined(__EMSCRIPTEN__)
  2820. for (int i = 0; i < SAPP_MAX_MOUSEBUTTONS; i++) {
  2821. simgui_add_mouse_button_event(i, false);
  2822. }
  2823. #endif
  2824. break;
  2825. case SAPP_EVENTTYPE_MOUSE_SCROLL:
  2826. simgui_add_mouse_wheel_event(ev->scroll_x, ev->scroll_y);
  2827. break;
  2828. case SAPP_EVENTTYPE_TOUCHES_BEGAN:
  2829. simgui_add_touch_pos_event(ev->touches[0].pos_x / dpi_scale, ev->touches[0].pos_y / dpi_scale);
  2830. simgui_add_touch_button_event(0, true);
  2831. break;
  2832. case SAPP_EVENTTYPE_TOUCHES_MOVED:
  2833. simgui_add_touch_pos_event(ev->touches[0].pos_x / dpi_scale, ev->touches[0].pos_y / dpi_scale);
  2834. break;
  2835. case SAPP_EVENTTYPE_TOUCHES_ENDED:
  2836. simgui_add_touch_pos_event(ev->touches[0].pos_x / dpi_scale, ev->touches[0].pos_y / dpi_scale);
  2837. simgui_add_touch_button_event(0, false);
  2838. break;
  2839. case SAPP_EVENTTYPE_TOUCHES_CANCELLED:
  2840. simgui_add_touch_button_event(0, false);
  2841. break;
  2842. case SAPP_EVENTTYPE_KEY_DOWN:
  2843. _simgui_update_modifiers(io, ev->modifiers);
  2844. // intercept Ctrl-V, this is handled via EVENTTYPE_CLIPBOARD_PASTED
  2845. if (!_simgui.desc.disable_paste_override) {
  2846. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_V)) {
  2847. break;
  2848. }
  2849. }
  2850. // on web platform, don't forward Ctrl-X, Ctrl-V to the browser
  2851. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_X)) {
  2852. sapp_consume_event();
  2853. }
  2854. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_C)) {
  2855. sapp_consume_event();
  2856. }
  2857. // it's ok to add ImGuiKey_None key events
  2858. _simgui_add_sapp_key_event(io, ev->key_code, true);
  2859. break;
  2860. case SAPP_EVENTTYPE_KEY_UP:
  2861. _simgui_update_modifiers(io, ev->modifiers);
  2862. // intercept Ctrl-V, this is handled via EVENTTYPE_CLIPBOARD_PASTED
  2863. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_V)) {
  2864. break;
  2865. }
  2866. // on web platform, don't forward Ctrl-X, Ctrl-V to the browser
  2867. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_X)) {
  2868. sapp_consume_event();
  2869. }
  2870. if (_simgui_is_ctrl(ev->modifiers) && (ev->key_code == SAPP_KEYCODE_C)) {
  2871. sapp_consume_event();
  2872. }
  2873. // it's ok to add ImGuiKey_None key events
  2874. _simgui_add_sapp_key_event(io, ev->key_code, false);
  2875. break;
  2876. case SAPP_EVENTTYPE_CHAR:
  2877. /* on some platforms, special keys may be reported as
  2878. characters, which may confuse some ImGui widgets,
  2879. drop those, also don't forward characters if some
  2880. modifiers have been pressed
  2881. */
  2882. _simgui_update_modifiers(io, ev->modifiers);
  2883. if ((ev->char_code >= 32) &&
  2884. (ev->char_code != 127) &&
  2885. (0 == (ev->modifiers & (SAPP_MODIFIER_ALT|SAPP_MODIFIER_CTRL|SAPP_MODIFIER_SUPER))))
  2886. {
  2887. simgui_add_input_character(ev->char_code);
  2888. }
  2889. break;
  2890. case SAPP_EVENTTYPE_CLIPBOARD_PASTED:
  2891. // simulate a Ctrl-V key down/up
  2892. if (!_simgui.desc.disable_paste_override) {
  2893. _simgui_add_imgui_key_event(io, _simgui_copypaste_modifier(), true);
  2894. _simgui_add_imgui_key_event(io, ImGuiKey_V, true);
  2895. _simgui_add_imgui_key_event(io, ImGuiKey_V, false);
  2896. _simgui_add_imgui_key_event(io, _simgui_copypaste_modifier(), false);
  2897. }
  2898. break;
  2899. default:
  2900. break;
  2901. }
  2902. return io->WantCaptureKeyboard || io->WantCaptureMouse;
  2903. }
  2904. #endif // SOKOL_IMGUI_NO_SOKOL_APP
  2905. #endif // SOKOL_IMPL