sokol_imgui.h 172 KB

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