Previous 199869 Revisions Next

r36034 Monday 2nd February, 2015 at 21:49:24 UTC by Ramiro Polla
Only evaluate sdl- and pkg-config commands once
[/branches/kale]makefile
[/branches/kale/3rdparty/bgfx].gitignore README.md
[/branches/kale/3rdparty/bgfx/3rdparty/ib-compress]readbitstream.h
[/branches/kale/3rdparty/bgfx/3rdparty/ocornut-imgui]imgui.cpp imgui.h
[/branches/kale/3rdparty/bgfx/examples/02-metaballs]metaballs.cpp
[/branches/kale/3rdparty/bgfx/examples/08-update]update.cpp
[/branches/kale/3rdparty/bgfx/examples/13-stencil]stencil.cpp
[/branches/kale/3rdparty/bgfx/examples/14-shadowvolumes]shadowvolumes.cpp
[/branches/kale/3rdparty/bgfx/examples/16-shadowmaps]shadowmaps.cpp
[/branches/kale/3rdparty/bgfx/examples/17-drawstress]drawstress.cpp
[/branches/kale/3rdparty/bgfx/examples/18-ibl]ibl.cpp
[/branches/kale/3rdparty/bgfx/examples/common]bgfx_utils.cpp common.h cube_atlas.cpp shaderlib.sh
[/branches/kale/3rdparty/bgfx/examples/common/entry]cmd.cpp cmd.h entry.cpp entry_osx.mm entry_p.h entry_x11.cpp input.cpp input.h
[/branches/kale/3rdparty/bgfx/examples/common/font]font_manager.cpp text_buffer_manager.cpp
[/branches/kale/3rdparty/bgfx/examples/common/imgui]fs_imgui_latlong.bin.h fs_imgui_latlong.sc imgui.cpp imgui.h ocornut_imgui.cpp vs_imgui_latlong.bin.h vs_imgui_latlong.sc
[/branches/kale/3rdparty/bgfx/examples/common/nanovg]fontstash.h nanovg_bgfx.cpp
[/branches/kale/3rdparty/bgfx/include]bgfx.c99.h bgfx.h bgfxplatform.h
[/branches/kale/3rdparty/bgfx/scripts]bgfx.lua
[/branches/kale/3rdparty/bgfx/src]bgfx.cpp bgfx_compute.sh bgfx_p.h glcontext_egl.cpp glcontext_egl.h glcontext_glx.cpp glcontext_glx.h glcontext_wgl.cpp glcontext_wgl.h glimports.h image.cpp image.h renderer_d3d11.cpp renderer_d3d12.cpp renderer_gl.cpp
[/branches/kale/3rdparty/bx/include/bx]macros.h
[/branches/kale/3rdparty/bx/tools/bin/darwin]genie
[/branches/kale/3rdparty/bx/tools/bin/linux]genie
[/branches/kale/3rdparty/bx/tools/bin/windows]genie.exe
[/branches/kale/3rdparty/genie]README.md
[/branches/kale/3rdparty/genie/build/gmake.darwin]genie.make
[/branches/kale/3rdparty/genie/build/gmake.linux]genie.make
[/branches/kale/3rdparty/genie/build/gmake.windows]genie.make
[/branches/kale/3rdparty/genie/src/actions/make]make_cpp.lua
[/branches/kale/3rdparty/genie/src/host]scripts.c
[/branches/kale/3rdparty/mongoose]LICENSE README.md mongoose.c
[/branches/kale/3rdparty/mongoose/docs]SSL.md
[/branches/kale/3rdparty/mongoose/examples/http_client]Makefile
[/branches/kale/3rdparty/sqlite3]sqlite3.c
[/branches/kale/hash]microvision.xml pencil2.xml uzebox.xml
[/branches/kale/src/build]build.mak flags_clang.mak flags_gcc.mak makelist.c* makelist.py verinfo.c* verinfo.py
[/branches/kale/src/emu]addrmap.h audit.c device.h diserial.c diserial.h fileio.c fileio.h input.c input.h ioport.c memory.c render.c render.h save.c save.h schedule.c sound.c tilemap.c
[/branches/kale/src/emu/bus/abckb]abc99.c
[/branches/kale/src/emu/bus/coco]coco_multi.c
[/branches/kale/src/emu/bus/isa]gblaster.c sblaster.c
[/branches/kale/src/emu/bus/pc_kbd]ec1841.c iskr1030.c pcat84.c pcxt83.c
[/branches/kale/src/emu/bus/rs232]keyboard.c
[/branches/kale/src/emu/cpu]cpu.mak
[/branches/kale/src/emu/cpu/amis2000]amis2000.c amis2000.h amis2000d.c amis2000op.inc
[/branches/kale/src/emu/cpu/i386]i386.h x87ops.inc
[/branches/kale/src/emu/cpu/i86]i186.c
[/branches/kale/src/emu/cpu/m6502]m6502.h
[/branches/kale/src/emu/cpu/m68000]m68000.h m68kcpu.c m68kcpu.h
[/branches/kale/src/emu/cpu/psx]dma.c
[/branches/kale/src/emu/cpu/ucom4]ucom4.c ucom4.h ucom4d.c ucom4op.inc
[/branches/kale/src/emu/debug]dvbpoints.c dvbpoints.h dvmemory.c dvmemory.h dvwpoints.c dvwpoints.h
[/branches/kale/src/emu/machine]6850acia.c i8251.c ins8250.c mc2661.c wd_fdc.c wozfdc.c z80dart.c
[/branches/kale/src/emu/sound]saa1099.c saa1099.h
[/branches/kale/src/emu/video]psx.c scn2674.c scn2674.h video.mak
[/branches/kale/src/lib]lib.mak
[/branches/kale/src/lib/formats]flex_dsk.c flex_dsk.h kaypro_dsk.c kaypro_dsk.h mbee_dsk.c* mbee_dsk.h* pc98_dsk.c trd_dsk.c trd_dsk.h
[/branches/kale/src/mame]mame.lst mame.mak
[/branches/kale/src/mame/audio]skydiver.c t5182.c t5182.h
[/branches/kale/src/mame/drivers]aleck64.c alg.c armedf.c bestleag.c bingor.c bloodbro.c bnstars.c buggychl.c cchance.c cclimber.c chaknpop.c champbas.c circus.c cops.c cyclemb.c d9final.c darkmist.c dcon.c dlair2.c dreamwld.c equites.c expro02.c exzisus.c fuukifg2.c fuukifg3.c galivan.c galpani2.c galpanic.c gladiatr.c gluck2.c goodejan.c gsword.c gunsmoke.c hornet.c igs011.c igs_m027.c iqblock.c jpmsys5.c liberate.c lindbergh.c manohman.c mastboy.c mcr.c megadrvb.c mitchell.c mpu4vid.c ms32.c mustache.c n8080.c namcops2.c naomi.c nbmj9195.c nmk16.c nwk-tr.c panicr.c peplus.c pipeline.c pirates.c pokechmp.c progolf.c quizo.c quizpani.c rabbit.c raiden2.c scotrsht.c segaorun.c segas16b.c segas32.c sengokmj.c shootout.c shougi.c sidearms.c sidepckt.c silvmil.c skeetsht.c skyarmy.c skydiver.c snowbros.c srmp5.c ssv.c st_mp100.c statriv2.c supduck.c tapatune.c taxidriv.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c tmmjprd.c tnzs.c toki.c triforce.c vamphalf.c vball.c wc90.c welltris.c wink.c wrally.c wwfsstar.c xorworld.c xxmissio.c
[/branches/kale/src/mame/includes]armedf.h bloodbro.h chaknpop.h darkmist.h dcon.h exzisus.h fuukifg2.h fuukifg3.h galivan.h galpanic.h gladiatr.h gsword.h iqblock.h liberate.h mustache.h nb1414m4.h pirates.h quizpani.h scotrsht.h shootout.h sidepckt.h skydiver.h snowbros.h taxidriv.h tecmo.h tecmo16.h tecmosys.h tehkanwc.h tnzs.h toki.h vball.h wc90.h welltris.h wrally.h wwfsstar.h xorworld.h xxmissio.h
[/branches/kale/src/mame/layout]superbug.lay
[/branches/kale/src/mame/machine]315-5838_317-0229_comp.c 315-5881_crypt.c 315_5296.c chaknpop.c nb1414m4.c pgmcrypt.c pgmcrypt.h tait8741.c tecmosys.c tnzs.c wrally.c
[/branches/kale/src/mame/video]bloodbro.c buggychl.c chaknpop.c darkmist.c dcon.c decospr.c decospr.h exzisus.c fuukifg2.c fuukifg3.c galpani2.c galpanic.c gladiatr.c gsword.c iqblock.c kaneko_spr.c kaneko_spr.h liberate.c mustache.c pirates.c quizpani.c scn2674.c* scn2674.h* scotrsht.c shootout.c sidepckt.c skydiver.c taxidriv.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c toki.c vball.c wc90.c welltris.c wrally.c wwfsstar.c xorworld.c xxmissio.c
[/branches/kale/src/mess]mess.lst mess.mak
[/branches/kale/src/mess/drivers]advision.c alesis.c alnchase.c amaztron.c atm.c c65.c cnsector.c comp4.c edracula.c elecdet.c hx20.c indiana.c kaypro.c mbee.c merlin.c ngen.c pc9801.c pcd.c pencil2.c pentagon.c prestige.c pt68k4.c samcoupe.c scorpion.c simon.c slicer.c spec128.c splitsec.c starwbc.c stopthie.c tb303.c tc4.c ti74.c ticalc1x.c tispeak.c tmtennis.c uzebox.c wildfire.c zorba.c
[/branches/kale/src/mess/includes]alesis.h kaypro.h mbee.h
[/branches/kale/src/mess/layout]alnchase.lay bankshot.lay edracula.lay tb303.lay tc4.lay tmtennis.lay wildfire.lay
[/branches/kale/src/mess/machine]apollo.c beta.c beta.h kaypro.c mbee.c ngen_kb.c ngen_kb.h pc1512kb.c pc9801_86.c victor9kb.c wangpckb.c
[/branches/kale/src/mess/osd/windows]windows.mak
[/branches/kale/src/mess/tools/imgtool/modules]ti990hd.c
[/branches/kale/src/mess/video]mbee.c spectrum.c
[/branches/kale/src/osd/modules/debugger]debugosx.h* debugosx.m debugqt.c debugwin.c
[/branches/kale/src/osd/modules/debugger/osx]breakpointsview.h breakpointsview.m consoleview.h consoleview.m debugcommandhistory.h debugcommandhistory.m debugconsole.h debugconsole.m debugosx.h debugview.h debugview.m debugwindowhandler.h debugwindowhandler.m deviceinfoviewer.h deviceinfoviewer.m devicesviewer.h devicesviewer.m disassemblyview.h disassemblyview.m disassemblyviewer.h disassemblyviewer.m errorlogview.h errorlogview.m errorlogviewer.h errorlogviewer.m memoryview.h memoryview.m memoryviewer.h memoryviewer.m pointsviewer.h pointsviewer.m registersview.h registersview.m watchpointsview.h watchpointsview.m
[/branches/kale/src/osd/modules/debugger/qt]breakpointswindow.c breakpointswindow.h dasmwindow.c dasmwindow.h debuggerview.c debuggerview.h debugqtbreakpointswindow.c* debugqtbreakpointswindow.h* debugqtdasmwindow.c* debugqtdasmwindow.h* debugqtdeviceinformationwindow.c* debugqtdeviceinformationwindow.h* debugqtdeviceswindow.c* debugqtdeviceswindow.h* debugqtlogwindow.c* debugqtlogwindow.h* debugqtmainwindow.c* debugqtmainwindow.h* debugqtmemorywindow.c* debugqtmemorywindow.h* debugqtview.c* debugqtview.h* debugqtwindow.c* debugqtwindow.h* deviceinformationwindow.c deviceinformationwindow.h deviceswindow.c deviceswindow.h logwindow.c logwindow.h mainwindow.c mainwindow.h memorywindow.c memorywindow.h windowqt.c windowqt.h
[/branches/kale/src/osd/modules/debugger/win]consolewininfo.c consolewininfo.h debugbaseinfo.c debugbaseinfo.h debugviewinfo.c debugviewinfo.h debugwin.h debugwininfo.c debugwininfo.h disasmbasewininfo.c disasmbasewininfo.h disasmviewinfo.c disasmviewinfo.h disasmwininfo.c disasmwininfo.h editwininfo.c editwininfo.h logwininfo.c logwininfo.h memoryviewinfo.c memoryviewinfo.h memorywininfo.c memorywininfo.h pointswininfo.c pointswininfo.h uimetrics.c uimetrics.h
[/branches/kale/src/osd/modules/sound]direct_sound.c js_sound.c sdl_sound.c
[/branches/kale/src/osd/osdmini]osdmini.mak
[/branches/kale/src/osd/sdl]draw13.c drawbgfx.c drawogl.c drawsdl.c input.c input.h osdsdl.h sdl.mak sdlmain.c testkeys.c video.c video.h window.c window.h
[/branches/kale/src/osd/windows]d3dcomm.h d3dhlsl.c d3dhlsl.h drawbgfx.c drawd3d.c drawd3d.h drawdd.c drawgdi.c drawnone.c input.c vconv.c video.c video.h window.c window.h windows.mak winmain.c winmain.h winprefix.h
[/branches/kale/src/tools]chdman.c unidasm.c
[/branches/kale/src/ume/osd/windows]windows.mak

branches/kale/3rdparty/bgfx/.gitignore
r244545r244546
44.git
55.svn
66tags
7src/renderer_d3d12.*
branches/kale/3rdparty/bgfx/3rdparty/ib-compress/readbitstream.h
r244545r244546
9595    }
9696}
9797
98
9899RBS_INLINE uint32_t ReadBitstream::Read( uint32_t bitCount )
99100{
100101    uint64_t mask   = ( uint64_t( 1 ) << bitCount ) - 1;
101    uint32_t result = static_cast< uint32_t >( ( m_bitBuffer >> ( 64 - m_bitsLeft ) & ( m_bitsLeft == 0 ? 0 : UINT64_C(0xFFFFFFFFFFFFFFFF) ) ) & mask );
102    uint32_t result = static_cast< uint32_t >( ( m_bitBuffer >> ( 64 - m_bitsLeft ) & ( m_bitsLeft == 0 ? 0 : 0xFFFFFFFFFFFFFFFF ) ) & mask );
102103
103104    if ( m_bitsLeft < bitCount )
104105    {
branches/kale/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
r244545r244546
1// ImGui library v1.32 wip
1// ImGui library v1.30
22// See ImGui::ShowTestWindow() for sample code.
33// Read 'Programmer guide' below for notes on how to setup ImGui in your codebase.
44// Get latest version at https://github.com/ocornut/imgui
r244545r244546
1717 - SAMPLE CODE
1818 - FONT DATA
1919
20
20
2121 MISSION STATEMENT
2222 =================
2323
r244545r244546
3535 - doesn't look fancy, doesn't animate
3636 - limited layout features, intricate layouts are typically crafted in code
3737 - occasionally use statically sized buffers for string manipulations - won't crash, but some long text may be clipped
38 
3839
39
4040 END-USER GUIDE
4141 ==============
4242
r244545r244546
6666 - your code creates the UI, if your code doesn't run the UI is gone! == dynamic UI, no construction step, less data retention on your side, no state duplication, less sync, less errors.
6767 - call and read ImGui::ShowTestWindow() for user-side sample code
6868 - see examples/ folder for standalone sample applications.
69 - customization: use the style editor or PushStyleColor/PushStyleVar to tweak the look of the interface (e.g. if you want a more compact UI or a different color scheme).
69 - customization: use the style editor to tweak the look of the interface (e.g. if you want a more compact UI or a different color scheme), and report values in your code.
7070
71
7271 - getting started:
7372   - initialisation: call ImGui::GetIO() and fill the 'Settings' data.
74   - every frame:
73   - every frame:
7574      1/ in your mainloop or right after you got your keyboard/mouse info, call ImGui::GetIO() and fill the 'Input' data, then call ImGui::NewFrame().
7675      2/ use any ImGui function you want between NewFrame() and Render()
7776      3/ ImGui::Render() to render all the accumulated command-lists. it will call your RenderDrawListFn handler that you set in the IO structure.
r244545r244546
9291        unsigned char* pixels;
9392        int width, height, bytes_per_pixels;
9493        io.Fonts->GetTexDataAsRGBA32(pixels, &width, &height, &bytes_per_pixels);
95        // TODO: copy texture to graphics memory.
94        // TODO: copy texture to graphics memory.
9695        // TODO: store your texture pointer/identifier in 'io.Fonts->TexID'
9796
9897        // Application main loop
r244545r244546
10099        {
101100            // 1) get low-level input
102101            // e.g. on Win32, GetKeyboardState(), or poll your events, etc.
103
102           
104103            // 2) TODO: fill all fields of IO structure and call NewFrame
105104            ImGuiIO& io = ImGui::GetIO();
106            io.MousePos = mouse_pos;
107            io.MouseDown[0] = mouse_button_0;
105            io.MousePos = ...
108106            io.KeysDown[i] = ...
109107            ImGui::NewFrame();
110108
r244545r244546
120118            // swap video buffer, etc.
121119        }
122120
123   - after calling ImGui::NewFrame() you can read back 'io.WantCaptureMouse' and 'io.WantCaptureKeyboard' to tell if ImGui
124     wants to use your inputs. if it does you can discard/hide the inputs from the rest of your application.
121   - after calling ImGui::NewFrame() you can read back 'io.WantCaptureMouse' and 'io.WantCaptureKeyboard' to tell
122     if ImGui wants to use your inputs. so typically can hide the mouse inputs from the rest of your application if ImGui is using it.
125123
124
126125 API BREAKING CHANGES
127126 ====================
128127
129128 Occasionally introducing changes that are breaking the API. The breakage are generally minor and easy to fix.
130129 Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
131
132 - 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior
133 - 2015/02/08 (1.31) - renamed GetTextLineSpacing() to GetTextLineHeightWithSpacing()
134 - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
130 
135131 - 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions.
136132 - 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader.
137133              (1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels.
r244545r244546
171167   - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
172168
173169 If you are confused about the meaning or use of ID in ImGui:
174   - many widgets requires state to be carried over multiple frames (most typically ImGui often wants remember what is the "active" widget).
170   - some widgets requires state to be carried over multiple frames (most typically ImGui often wants remember what is the "active" widget).
175171     to do so they need an unique ID. unique ID are typically derived from a string label, an indice or a pointer.
176172     when you call Button("OK") the button shows "OK" and also use "OK" as an ID.
177173   - ID are uniquely scoped within Windows so no conflict can happen if you have two buttons called "OK" in two different Windows.
178     within a same Window, use PushID() / PopID() to easily create scopes and avoid ID conflicts.
174     within a same Window, use PushID() / PopID() to easily create scopes and avoid ID conflicts.
179175     so if you have a loop creating "multiple" items, you can use PushID() / PopID() with the index of each item, or their pointer, etc.
180176     some functions like TreeNode() implicitly creates a scope for you by calling PushID()
181177   - when dealing with trees, ID are important because you want to preserve the opened/closed state of tree nodes.
182178     depending on your use cases you may want to use strings, indices or pointers as ID. experiment and see what makes more sense!
183      e.g. When displaying a single object that may change over time, using a static string as ID will preserve your node open/closed state when the targeted object change
179      e.g. When displaying a single object, using a static string as ID will preserve your node open/closed state when the targeted object change
184180      e.g. When displaying a list of objects, using indices or pointers as ID will preserve the node open/closed state per object
185181   - when passing a label you can optionally specify extra unique ID information within the same string using "##". This helps solving the simpler collision cases.
186182      e.g. "Label" display "Label" and uses "Label" as ID
187183      e.g. "Label##Foobar" display "Label" and uses "Label##Foobar" as ID
188184      e.g. "##Foobar" display an empty label and uses "##Foobar" as ID
189   - read articles about immediate-mode ui principles (see web links) to understand the requirement and use of ID.
185   - read articles about the imgui principles (see web links) to understand the requirement and use of ID.
190186
191187 If you want to load a different font than the default (ProggyClean.ttf, size 13)
192188
r244545r244546
197193
198194     ImFont* font0 = io.Fonts->AddFontDefault();
199195     ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
200     ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
201196     io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
202197
203198 If you want to display Chinese, Japanese, Korean characters, pass custom Unicode ranges when loading a font:
r244545r244546
229224        // Set pointer to handler in ImGuiIO structure
230225        io.ImeSetInputScreenPosFn = ImImpl_ImeSetInputScreenPosFn;
231226
232 - tip: the construct 'IMGUI_ONCE_UPON_A_FRAME { ... }' will run the block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code.
227 - tip: the construct 'IMGUI_ONCE_UPON_A_FRAME { ... }' will evaluate to a block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code.
228 - tip: you can call Render() multiple times (e.g for VR renders), up to you to communicate the extra state to your RenderDrawListFn function.
233229 - tip: you can create widgets without a Begin()/End() block, they will go in an implicit window called "Debug"
234 - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window.
235 - tip: you can call Render() multiple times (e.g for VR renders).
236230 - tip: call and read the ShowTestWindow() code for more example of how to use ImGui!
237231
238232
r244545r244546
240234 ==================
241235
242236 - misc: merge or clarify ImVec4 / ImGuiAabb, they are essentially duplicate containers
237!- i/o: avoid requesting mouse capture if button held and initial click was out of reach for imgui
243238 - window: add horizontal scroll
244239 - window: fix resize grip rendering scaling along with Rounding style setting
245240 - window: autofit feedback loop when user relies on any dynamic layout (window width multiplier, column). maybe just clearly drop manual autofit?
246 - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list.
241 - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list.
247242 - window: allow resizing of child windows (possibly given min/max for each axis?)
248243 - window: background options for child windows, border option (disable rounding)
249244 - window: resizing from any sides? + mouse cursor directives for app.
250 - widgets: clicking on widget b while widget a should activate widget b (doesn't anymore because of hover capture)
251245 - widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
252246 - widgets: clip text? hover clipped text shows it in a tooltip or in-place overlay
253 - main: considering adding EndFrame()/Init(). some constructs are awkward in the implementation because of the lack of them.
247 - main: considering adding EndFrame() - optional, else done in Render(). and Init()
254248 - main: IsItemHovered() returns true even if mouse is active on another widget (e.g. dragging outside of sliders). Maybe not a sensible default? Add parameter or alternate function?
255249 - main: IsItemHovered() make it more consistent for various type of widgets, widgets with multiple components, etc. also effectively IsHovered() region sometimes differs from hot region, e.g tree nodes
256250 - main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
r244545r244546
262256 - input number: use mouse wheel to step up/down
263257 - input number: non-decimal input.
264258 - layout: horizontal layout helper (github issue #97)
265 - layout: more generic alignment state (left/right/centered) for single items?
266259 - layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
267260 - columns: separator function or parameter that works within the column (currently Separator() bypass all columns)
268261 - columns: declare column set (each column: fixed size, %, fill, distribute default size among fills)
269262 - columns: columns header to act as button (~sort op) and allow resize/reorder
270263 - columns: user specify columns size
271264 - combo: turn child handling code into pop up helper
272 - combo: contents should extends to fit label if combo widget is small
273 - listbox: multiple selection
274 - listbox: user may want to initial scroll to focus on the one selected value?
275 ! menubar, menus
265 - list selection, concept of a selectable "block" (that can be multiple widgets)
266 - menubar, menus
276267 - tabs
277268 - gauge: various forms of gauge/loading bars widgets
278269 - color: better color editor.
279 - plot: make it easier for user to draw extra stuff into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
280 - plot: "smooth" automatic scale over time, user give an input 0.0(full user scale) 1.0(full derived from value)
270 - plot: make it easier for user to draw into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
271 - plot: "smooth" automatic scale, user give an input 0.0(full user scale) 1.0(full derived from value)
281272 - plot: add a helper e.g. Plot(char* label, float value, float time_span=2.0f) that stores values and Plot them for you - probably another function name. and/or automatically allow to plot ANY displayed value (more reliance on stable ID)
282 - file selection widget -> build the tool in our codebase to improve model-dialog idioms
273 - file selection widget -> build the tool in our codebase to improve model-dialog idioms (may or not lead to ImGui changes)
283274 - slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
284275 - slider: initial absolute click is imprecise. change to relative movement slider? hide mouse cursor, allow more precise input using less screen-space.
285 - text edit: clean up the mess caused by converting UTF-8 <> wchar. the code is rather ineficient right now.
286 - text edit: centered text for slider as input text so it matches typical positioning.
287 - text edit: flag to disable live update of the user buffer.
276 - text edit: clean up the mess caused by converting UTF-8 <> wchar
277 - text edit: centered text for slider or input text to it matches typical positioning.
278 - text edit: flag to disable live update of the user buffer.
288279 - text edit: field resize behavior - field could stretch when being edited? hover tooltip shows more text?
289280 - text edit: add multi-line text edit
290281 - tree: add treenode/treepush int variants? because (void*) cast from int warns on some platforms/settings
291282 - settings: write more decent code to allow saving/loading new fields
292283 - settings: api for per-tool simple persistent data (bool,int,float) in .ini file
293 ! style: store rounded corners in texture to use 1 quad per corner (filled and wireframe). so rounding have minor cost.
294 - style: checkbox: padding for "active" color should be a multiplier of the
284 ! style: store rounded corners in texture to use 1 quad per corner (filled and wireframe).
285 - style: checkbox: padding for "active" color should be a multiplier of the
295286 - style: colorbox not always square?
296287 - log: LogButtons() options for specifying depth and/or hiding depth slider
297288 - log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
r244545r244546
308299 - misc: mark printf compiler attributes on relevant functions
309300 - misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
310301 - misc: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
311 - style editor: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space?
312302 - style editor: color child window height expressed in multiple of line height.
313303 - optimization/render: use indexed rendering to reduce vertex data cost (for remote/networked imgui)
304 - optimization/render: move clip-rect to vertex data? would allow merging all commands
314305 - optimization/render: merge command-lists with same clip-rect into one even if they aren't sequential? (as long as in-between clip rectangle don't overlap)?
315306 - optimization: turn some the various stack vectors into statically-sized arrays
316307 - optimization: better clipping for multi-component widgets
r244545r244546
329320#include <new>          // new (ptr)
330321
331322#ifdef _MSC_VER
332#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
323#pragma warning (disable: 4505) // unreferenced local function has been removed
333324#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
334325#endif
335326
r244545r244546
401392// Forward Declarations
402393//-------------------------------------------------------------------------
403394
404struct ImGuiAabb;
405
406static bool         ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat = false, bool pressed_on_click = false);
395static bool         ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat = false);
407396static void         LogText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL);
408397
409static void         RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
410static void         RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
411static void         RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& clip_max);
398static void         RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true, float wrap_width = 0.0f);
412399static void         RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
413400static void         RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale = 1.0f, bool shadow = false);
414401
r244545r244546
476463    WindowPadding           = ImVec2(8,8);      // Padding within a window
477464    WindowMinSize           = ImVec2(32,32);    // Minimum window size
478465    WindowRounding          = 9.0f;             // Radius of window corners rounding. Set to 0.0f to have rectangular windows
479    ChildWindowRounding     = 0.0f;             // Radius of child window corners rounding. Set to 0.0f to have rectangular windows
480466    FramePadding            = ImVec2(4,3);      // Padding within a framed rectangle (used by most widgets)
481467    FrameRounding           = 0.0f;             // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
482468    ItemSpacing             = ImVec2(8,4);      // Horizontal and vertical spacing between widgets/lines
r244545r244546
490476
491477    Colors[ImGuiCol_Text]                   = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
492478    Colors[ImGuiCol_WindowBg]               = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
493    Colors[ImGuiCol_ChildWindowBg]          = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
494479    Colors[ImGuiCol_Border]                 = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
495480    Colors[ImGuiCol_BorderShadow]           = ImVec4(0.00f, 0.00f, 0.00f, 0.60f);
496481    Colors[ImGuiCol_FrameBg]                = ImVec4(0.80f, 0.80f, 0.80f, 0.30f);   // Background of checkbox, radio button, plot, slider, text input
r244545r244546
511496    Colors[ImGuiCol_ButtonActive]           = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
512497    Colors[ImGuiCol_Header]                 = ImVec4(0.40f, 0.40f, 0.90f, 0.45f);
513498    Colors[ImGuiCol_HeaderHovered]          = ImVec4(0.45f, 0.45f, 0.90f, 0.80f);
514    Colors[ImGuiCol_HeaderActive]           = ImVec4(0.53f, 0.53f, 0.87f, 0.80f);
499    Colors[ImGuiCol_HeaderActive]           = ImVec4(0.60f, 0.60f, 0.80f, 1.00f);
515500    Colors[ImGuiCol_Column]                 = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
516501    Colors[ImGuiCol_ColumnHovered]          = ImVec4(0.60f, 0.40f, 0.40f, 1.00f);
517502    Colors[ImGuiCol_ColumnActive]           = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
r244545r244546
554539    // User functions
555540    RenderDrawListsFn = NULL;
556541    MemAllocFn = malloc;
542    MemReallocFn = realloc;
557543    MemFreeFn = free;
558544    GetClipboardTextFn = GetClipboardTextFn_DefaultImpl;   // Platform dependent default implementations
559545    SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
r244545r244546
614600static inline float  ImMax(float lhs, float rhs)                                { return lhs >= rhs ? lhs : rhs; }
615601static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs)                { return ImVec2(ImMin(lhs.x,rhs.x), ImMin(lhs.y,rhs.y)); }
616602static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs)                { return ImVec2(ImMax(lhs.x,rhs.x), ImMax(lhs.y,rhs.y)); }
617static inline int    ImClamp(int v, int mn, int mx)                             { return (v < mn) ? mn : (v > mx) ? mx : v; }
618static inline float  ImClamp(float v, float mn, float mx)                       { return (v < mn) ? mn : (v > mx) ? mx : v; }
603static inline float  ImClamp(float f, float mn, float mx)                       { return (f < mn) ? mn : (f > mx) ? mx : f; }
619604static inline ImVec2 ImClamp(const ImVec2& f, const ImVec2& mn, ImVec2 mx)      { return ImVec2(ImClamp(f.x,mn.x,mx.x), ImClamp(f.y,mn.y,mx.y)); }
620605static inline float  ImSaturate(float f)                                        { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
621606static inline float  ImLerp(float a, float b, float t)                          { return a + (b - a) * t; }
r244545r244546
675660}
676661
677662// Pass data_size==0 for zero-terminated string
678static ImU32 ImCrc32(const void* data, size_t data_size, ImU32 seed = 0)
679{
663static ImU32 ImCrc32(const void* data, size_t data_size, ImU32 seed = 0)
664{
680665    static ImU32 crc32_lut[256] = { 0 };
681666    if (!crc32_lut[1])
682667    {
683668        const ImU32 polynomial = 0xEDB88320;
684        for (ImU32 i = 0; i < 256; i++)
685        {
686            ImU32 crc = i;
687            for (ImU32 j = 0; j < 8; j++)
688                crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
689            crc32_lut[i] = crc;
669        for (ImU32 i = 0; i < 256; i++)
670        {
671            ImU32 crc = i;
672            for (ImU32 j = 0; j < 8; j++)
673                crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
674            crc32_lut[i] = crc;
690675        }
691676    }
692    ImU32 crc = ~seed;
677    ImU32 crc = ~seed;
693678    const unsigned char* current = (const unsigned char*)data;
694679
695680    if (data_size > 0)
696681    {
697682        // Known size
698        while (data_size--)
699            crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
683        while (data_size--)
684            crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
700685    }
701686    else
702687    {
703688        // Zero-terminated string
704689        while (unsigned char c = *current++)
705            crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
690            crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
706691    }
707    return ~crc;
708}
692    return ~crc;
693}
709694
710695static size_t ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
711696{
r244545r244546
758743// Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593
759744// also http://en.wikipedia.org/wiki/HSL_and_HSV
760745void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b)
761{
746{   
762747    if (s == 0.0f)
763748    {
764749        // gray
r244545r244546
883868    bool                    LastItemHovered;
884869    ImVector<ImGuiWindow*>  ChildWindows;
885870    ImVector<bool>          AllowKeyboardFocus;
886    ImVector<float>         ItemWidth;           // 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
871    ImVector<float>         ItemWidth;
887872    ImVector<float>         TextWrapPos;
888873    ImGuiColorEditMode      ColorEditMode;
889874    ImGuiStorage*           StateStorage;
890    int                     OpenNextNode;        // FIXME: Reformulate this feature like SetNextWindowCollapsed() API
875    int                     OpenNextNode;
891876
892877    float                   ColumnsStartX;       // Start position from left of window (increased by TreePush/TreePop, etc.)
893878    float                   ColumnsOffsetX;      // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
r244545r244546
1001986
1002987    // Render
1003988    ImVector<ImDrawList*>   RenderDrawLists;
1004    ImVector<ImGuiWindow*>  RenderSortedWindows;
1005989
1006990    // Widget state
1007991    ImGuiTextEditState      InputTextState;
r244545r244546
10481032    }
10491033};
10501034
1051static ImGuiState   GImDefaultState;                            // Internal state storage
1052static ImGuiState*  GImGui = &GImDefaultState;                  // We access everything through this pointer. NB: this pointer is always assumed to be != NULL
1035static ImGuiState   GImGui;
10531036
10541037struct ImGuiWindow
10551038{
r244545r244546
10701053    bool                    SkipItems;                          // == Visible && !Collapsed
10711054    int                     AutoFitFrames;
10721055    bool                    AutoFitOnlyGrows;
1073    int                     SetWindowPosAllowFlags;             // bit ImGuiSetCondition_*** specify if SetWindowPos() call is allowed with this particular flag.
1074    int                     SetWindowSizeAllowFlags;            // bit ImGuiSetCondition_*** specify if SetWindowSize() call is allowed with this particular flag.
1075    int                     SetWindowCollapsedAllowFlags;       // bit ImGuiSetCondition_*** specify if SetWindowCollapsed() call is allowed with this particular flag.
1056    int                     SetWindowPosAllowFlags;             // bit ImGuiSetCondition_*** specify if SetWindowPos() call is allowed with this particular flag.
1057    int                     SetWindowSizeAllowFlags;            // bit ImGuiSetCondition_*** specify if SetWindowSize() call is allowed with this particular flag.
1058    int                     SetWindowCollapsedAllowFlags;       // bit ImGuiSetCondition_*** specify if SetWindowCollapsed() call is allowed with this particular flag.
10761059
10771060    ImGuiDrawContext        DC;
10781061    ImVector<ImGuiID>       IDStack;
1079    ImVector<ImVec4>        ClipRectStack;                      // Scissoring / clipping rectangle. x1, y1, x2, y2.
1062    ImVector<ImVec4>        ClipRectStack;
10801063    int                     LastFrameDrawn;
10811064    float                   ItemWidthDefault;
10821065    ImGuiStorage            StateStorage;
r244545r244546
11041087    void        FocusItemUnregister();
11051088
11061089    ImGuiAabb   Aabb() const                            { return ImGuiAabb(Pos, Pos+Size); }
1107    ImFont*     Font() const                            { return GImGui->Font; }
1108    float       FontSize() const                        { return GImGui->FontSize * FontWindowScale; }
1090    ImFont*     Font() const                            { return GImGui.Font; }
1091    float       FontSize() const                        { return GImGui.FontSize * FontWindowScale; }
11091092    ImVec2      CursorPos() const                       { return DC.CursorPos; }
1110    float       TitleBarHeight() const                  { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0 : FontSize() + GImGui->Style.FramePadding.y * 2.0f; }
1093    float       TitleBarHeight() const                  { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0 : FontSize() + GImGui.Style.FramePadding.y * 2.0f; }
11111094    ImGuiAabb   TitleBarAabb() const                    { return ImGuiAabb(Pos, Pos + ImVec2(SizeFull.x, TitleBarHeight())); }
1112    ImVec2      WindowPadding() const                   { return ((Flags & ImGuiWindowFlags_ChildWindow) && !(Flags & ImGuiWindowFlags_ShowBorders)) ? ImVec2(1,1) : GImGui->Style.WindowPadding; }
1113    ImU32       Color(ImGuiCol idx, float a=1.f) const  { ImVec4 c = GImGui->Style.Colors[idx]; c.w *= GImGui->Style.Alpha * a; return ImGui::ColorConvertFloat4ToU32(c); }
1114    ImU32       Color(const ImVec4& col) const          { ImVec4 c = col; c.w *= GImGui->Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
1095    ImVec2      WindowPadding() const                   { return ((Flags & ImGuiWindowFlags_ChildWindow) && !(Flags & ImGuiWindowFlags_ShowBorders)) ? ImVec2(1,1) : GImGui.Style.WindowPadding; }
1096    ImU32       Color(ImGuiCol idx, float a=1.f) const  { ImVec4 c = GImGui.Style.Colors[idx]; c.w *= GImGui.Style.Alpha * a; return ImGui::ColorConvertFloat4ToU32(c); }
1097    ImU32       Color(const ImVec4& col) const          { ImVec4 c = col; c.w *= GImGui.Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
11151098};
11161099
11171100static ImGuiWindow* GetCurrentWindow()
11181101{
1119    ImGuiState& g = *GImGui;
1120    IM_ASSERT(g.CurrentWindow != NULL);    // ImGui::NewFrame() hasn't been called yet?
1121    g.CurrentWindow->Accessed = true;
1122    return g.CurrentWindow;
1102    IM_ASSERT(GImGui.CurrentWindow != NULL);    // ImGui::NewFrame() hasn't been called yet?
1103    GImGui.CurrentWindow->Accessed = true;
1104    return GImGui.CurrentWindow;
11231105}
11241106
1125static void SetActiveId(ImGuiID id)
1107static void SetActiveId(ImGuiID id)
11261108{
1127    ImGuiState& g = *GImGui;
1128    g.ActiveId = id;
1109    GImGui.ActiveId = id;
11291110}
11301111
11311112static void RegisterAliveId(const ImGuiID& id)
11321113{
1133    ImGuiState& g = *GImGui;
1134    if (g.ActiveId == id)
1135        g.ActiveIdIsAlive = true;
1114    if (GImGui.ActiveId == id)
1115        GImGui.ActiveIdIsAlive = true;
11361116}
11371117
11381118//-----------------------------------------------------------------------------
r244545r244546
12631243    if (width < 0.0f)
12641244    {
12651245        ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
1266        width = ImMax(window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x - (label_size.x + GImGui->Style.ItemSpacing.x*4), 10.0f);
1246        width = ImMax(window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x - (label_size.x + GImGui.Style.ItemSpacing.x*4), 10.0f);
12671247    }
12681248    ImGui::PushItemWidth(width);
12691249    ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
r244545r244546
13421322
13431323//-----------------------------------------------------------------------------
13441324
1345// On some platform vsnprintf() takes va_list by reference and modifies it.
1325// On some platform vsnprintf() takes va_list by reference and modifies it.
13461326// va_copy is the 'correct' way to copy a va_list but Visual Studio prior to 2013 doesn't have it.
13471327#ifndef va_copy
13481328#define va_copy(dest, src) (dest = src)
r244545r244546
13831363ImGuiWindow::ImGuiWindow(const char* name)
13841364{
13851365    Name = ImStrdup(name);
1386    ID = GetID(name);
1366    ID = GetID(name);
13871367    IDStack.push_back(ID);
13881368
13891369    PosFloat = Pos = ImVec2(0.0f, 0.0f);
r244545r244546
14451425
14461426bool ImGuiWindow::FocusItemRegister(bool is_active, bool tab_stop)
14471427{
1448    ImGuiState& g = *GImGui;
1428    ImGuiState& g = GImGui;
14491429    ImGuiWindow* window = GetCurrentWindow();
14501430
14511431    const bool allow_keyboard_focus = window->DC.AllowKeyboardFocus.back();
r244545r244546
14791459
14801460void ImGuiWindow::AddToRenderList()
14811461{
1482    ImGuiState& g = *GImGui;
1462    ImGuiState& g = GImGui;
14831463
14841464    if (!DrawList->commands.empty() && !DrawList->vtx_buffer.empty())
14851465    {
r244545r244546
14901470    for (size_t i = 0; i < DC.ChildWindows.size(); i++)
14911471    {
14921472        ImGuiWindow* child = DC.ChildWindows[i];
1493        if (child->Visible)                 // clipped children may have been marked not Visible
1473        if (child->Visible)                 // clipped childs may have been marked not Visible
14941474            child->AddToRenderList();
14951475    }
14961476}
r244545r244546
14991479
15001480void* ImGui::MemAlloc(size_t sz)
15011481{
1502    return GImGui->IO.MemAllocFn(sz);
1482    return GImGui.IO.MemAllocFn(sz);
15031483}
15041484
15051485void ImGui::MemFree(void* ptr)
15061486{
1507    return GImGui->IO.MemFreeFn(ptr);
1487    return GImGui.IO.MemFreeFn(ptr);
15081488}
15091489
1490void* ImGui::MemRealloc(void* ptr, size_t sz)
1491{
1492    return GImGui.IO.MemReallocFn(ptr, sz);
1493}
1494   
15101495static ImGuiIniData* FindWindowSettings(const char* name)
15111496{
1512    ImGuiState& g = *GImGui;
1497    ImGuiState& g = GImGui;
15131498    for (size_t i = 0; i != g.Settings.size(); i++)
15141499    {
15151500        ImGuiIniData* ini = g.Settings[i];
r244545r244546
15271512    ini->Collapsed = false;
15281513    ini->Pos = ImVec2(FLT_MAX,FLT_MAX);
15291514    ini->Size = ImVec2(0,0);
1530    GImGui->Settings.push_back(ini);
1515    GImGui.Settings.push_back(ini);
15311516    return ini;
15321517}
15331518
r244545r244546
15351520// FIXME: Write something less rubbish
15361521static void LoadSettings()
15371522{
1538    ImGuiState& g = *GImGui;
1523    ImGuiState& g = GImGui;
15391524    const char* filename = g.IO.IniFilename;
15401525    if (!filename)
15411526        return;
r244545r244546
15521537        const char* line_end = line_start;
15531538        while (line_end < buf_end && *line_end != '\n' && *line_end != '\r')
15541539            line_end++;
1555
1540       
15561541        if (line_start[0] == '[' && line_end > line_start && line_end[-1] == ']')
15571542        {
15581543            char name[64];
r244545r244546
15811566
15821567static void SaveSettings()
15831568{
1584    ImGuiState& g = *GImGui;
1569    ImGuiState& g = GImGui;
15851570    const char* filename = g.IO.IniFilename;
15861571    if (!filename)
15871572        return;
r244545r244546
16201605
16211606static void MarkSettingsDirty()
16221607{
1623    ImGuiState& g = *GImGui;
1608    ImGuiState& g = GImGui;
16241609
16251610    if (g.SettingsDirtyTimer <= 0.0f)
16261611        g.SettingsDirtyTimer = g.IO.IniSavingRate;
16271612}
16281613
1629// Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
1630// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
1631void* ImGui::GetInternalState()
1632{
1633    return GImGui;
1634}
1635
1636size_t ImGui::GetInternalStateSize()
1637{
1638    return sizeof(ImGuiState);
1639}
1640
1641void ImGui::SetInternalState(void* state, bool construct)
1642{
1643    if (construct)
1644        new (state) ImGuiState();
1645
1646    GImGui = (ImGuiState*)state;
1647}
1648
16491614ImGuiIO& ImGui::GetIO()
16501615{
1651    return GImGui->IO;
1616    return GImGui.IO;
16521617}
16531618
16541619ImGuiStyle& ImGui::GetStyle()
16551620{
1656    return GImGui->Style;
1621    return GImGui.Style;
16571622}
16581623
16591624void ImGui::NewFrame()
16601625{
1661    ImGuiState& g = *GImGui;
1626    ImGuiState& g = GImGui;
16621627
16631628    // Check user data
16641629    IM_ASSERT(g.IO.DeltaTime > 0.0f);
r244545r244546
17371702    else
17381703        g.HoveredRootWindow = FindHoveredWindow(g.IO.MousePos, true);
17391704
1740    // Are we using inputs? Tell user so they can capture/discard the inputs away from the rest of their application.
1741    // When clicking outside of a window we assume the click is owned by the application and won't request capture.
1742    int mouse_earliest_button_down = -1;
1743    for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
1744    {
1745        if (g.IO.MouseClicked[i])
1746            g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL);
1747        if (g.IO.MouseDown[i])
1748            if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
1749                mouse_earliest_button_down = i;
1750    }
1751    bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
1752    g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (g.ActiveId != 0);
1705    // Are we using inputs? Tell user so they can capture/discard them.
1706    g.IO.WantCaptureMouse = (g.HoveredWindow != NULL) || (g.ActiveId != 0);
17531707    g.IO.WantCaptureKeyboard = (g.ActiveId != 0);
17541708
1755    // If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
1756    if (mouse_owned_by_application)
1757        g.HoveredWindow = g.HoveredRootWindow = NULL;
1758
17591709    // Scale & Scrolling
17601710    if (g.HoveredWindow && g.IO.MouseWheel != 0.0f)
17611711    {
r244545r244546
18061756
18071757    // No window should be open at the beginning of the frame.
18081758    // But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
1809    g.CurrentWindowStack.resize(0);
1759    g.CurrentWindowStack.clear();
18101760
18111761    // Create implicit window - we will only render it if the user has added something to it.
18121762    ImGui::Begin("Debug", NULL, ImVec2(400,400));
r244545r244546
18151765// NB: behaviour of ImGui after Shutdown() is not tested/guaranteed at the moment. This function is merely here to free heap allocations.
18161766void ImGui::Shutdown()
18171767{
1818    ImGuiState& g = *GImGui;
1768    ImGuiState& g = GImGui;
18191769    if (!g.Initialized)
18201770        return;
18211771
r244545r244546
18641814    g.Initialized = false;
18651815}
18661816
1867// FIXME: Add a more explicit sort order in the window structure.
1868static int ChildWindowComparer(const void* lhs, const void* rhs)
1869{
1870    const ImGuiWindow* a = *(const ImGuiWindow**)lhs;
1871    const ImGuiWindow* b = *(const ImGuiWindow**)rhs;
1872    if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip))
1873        return d;
1874    if (int d = (a->Flags & ImGuiWindowFlags_ComboBox) - (b->Flags & ImGuiWindowFlags_ComboBox))
1875        return d;
1876    return 0;
1877}
1878
18791817static void AddWindowToSortedBuffer(ImGuiWindow* window, ImVector<ImGuiWindow*>& sorted_windows)
18801818{
18811819    sorted_windows.push_back(window);
18821820    if (window->Visible)
18831821    {
1884        const size_t count = window->DC.ChildWindows.size();
1885        if (count > 1)
1886            qsort(window->DC.ChildWindows.begin(), count, sizeof(ImGuiWindow*), ChildWindowComparer);
1887        for (size_t i = 0; i < count; i++)
1822        for (size_t i = 0; i < window->DC.ChildWindows.size(); i++)
18881823        {
18891824            ImGuiWindow* child = window->DC.ChildWindows[i];
18901825            if (child->Visible)
r244545r244546
19001835    ImVec4 cr = clip_rect;
19011836    if (clipped && !window->ClipRectStack.empty())
19021837    {
1903        // Clip with existing clip rect
1838        // Clip to new clip rect
19041839        const ImVec4 cur_cr = window->ClipRectStack.back();
19051840        cr = ImVec4(ImMax(cr.x, cur_cr.x), ImMax(cr.y, cur_cr.y), ImMin(cr.z, cur_cr.z), ImMin(cr.w, cur_cr.w));
19061841    }
r244545r244546
19181853
19191854void ImGui::Render()
19201855{
1921    ImGuiState& g = *GImGui;
1856    ImGuiState& g = GImGui;
19221857    IM_ASSERT(g.Initialized);                       // Forgot to call ImGui::NewFrame()
19231858
19241859    const bool first_render_of_the_frame = (g.FrameCountRendered != g.FrameCount);
19251860    g.FrameCountRendered = g.FrameCount;
1926
1861   
19271862    if (first_render_of_the_frame)
19281863    {
19291864        // Hide implicit window if it hasn't been used
1930        IM_ASSERT(g.CurrentWindowStack.size() == 1);    // Mismatched Begin/End
1865        IM_ASSERT(g.CurrentWindowStack.size() == 1);    // Mismatched Begin/End
19311866        if (g.CurrentWindow && !g.CurrentWindow->Accessed)
19321867            g.CurrentWindow->Visible = false;
19331868        ImGui::End();
19341869
1935        // Select window for move/focus when we're done with all our widgets (we only consider non-child windows here)
1870        // Select window for move/focus when we're done with all our widgets (we only consider non-childs windows here)
19361871        if (g.ActiveId == 0 && g.HoveredId == 0 && g.HoveredRootWindow != NULL && g.IO.MouseClicked[0])
19371872            SetActiveId(g.HoveredRootWindow->GetID("#MOVE"));
19381873
19391874        // Sort the window list so that all child windows are after their parent
19401875        // We cannot do that on FocusWindow() because childs may not exist yet
1941        g.RenderSortedWindows.resize(0);
1942        g.RenderSortedWindows.reserve(g.Windows.size());
1876        ImVector<ImGuiWindow*> sorted_windows;
1877        sorted_windows.reserve(g.Windows.size());
19431878        for (size_t i = 0; i != g.Windows.size(); i++)
19441879        {
19451880            ImGuiWindow* window = g.Windows[i];
19461881            if (window->Flags & ImGuiWindowFlags_ChildWindow)           // if a child is visible its parent will add it
19471882                if (window->Visible)
19481883                    continue;
1949            AddWindowToSortedBuffer(window, g.RenderSortedWindows);
1884            AddWindowToSortedBuffer(window, sorted_windows);
19501885        }
1951        IM_ASSERT(g.Windows.size() == g.RenderSortedWindows.size());    // we done something wrong
1952        g.Windows.swap(g.RenderSortedWindows);
1886        IM_ASSERT(g.Windows.size() == sorted_windows.size());           // We done something wrong
1887        g.Windows.swap(sorted_windows);
19531888
19541889        // Clear data for next frame
19551890        g.IO.MouseWheel = 0.0f;
r244545r244546
20181953// Pass text data straight to log (without being displayed)
20191954void ImGui::LogText(const char* fmt, ...)
20201955{
2021    ImGuiState& g = *GImGui;
1956    ImGuiState& g = GImGui;
20221957    if (!g.LogEnabled)
20231958        return;
20241959
r244545r244546
20361971}
20371972
20381973// Internal version that takes a position to decide on newline placement and pad items according to their depth.
2039// We split text into individual lines to add current tree level padding
20401974static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end)
20411975{
2042    ImGuiState& g = *GImGui;
1976    ImGuiState& g = GImGui;
20431977    ImGuiWindow* window = GetCurrentWindow();
20441978
20451979    if (!text_end)
r244545r244546
20962030        wrap_pos_x = ImGui::GetContentRegionMax().x;
20972031    if (wrap_pos_x > 0.0f)
20982032        wrap_pos_x += window->Pos.x; // wrap_pos_x is provided is window local space
2099
2033   
21002034    const float wrap_width = wrap_pos_x > 0.0f ? ImMax(wrap_pos_x - pos.x, 0.00001f) : 0.0f;
21012035    return wrap_width;
21022036}
21032037
2104// Internal ImGui functions to render text
2105// RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
2106static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash)
2038// Internal ImGui function to render text (called from ImGui::Text(), ImGui::TextUnformatted(), etc.)
2039// RenderText() calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
2040static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash, float wrap_width)
21072041{
2108    ImGuiState& g = *GImGui;
2042    ImGuiState& g = GImGui;
21092043    ImGuiWindow* window = GetCurrentWindow();
21102044
21112045    // Hide anything after a '##' string
r244545r244546
21252059    if (text_len > 0)
21262060    {
21272061        // Render
2128        window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_display_end);
2062        window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text + text_len, wrap_width);
21292063
2130        // Log as text
2064        // Log as text. We split text into individual lines to add current tree level padding
21312065        if (g.LogEnabled)
21322066            LogText(pos, text, text_display_end);
21332067    }
21342068}
21352069
2136static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width)
2137{
2138    ImGuiState& g = *GImGui;
2139    ImGuiWindow* window = GetCurrentWindow();
2140
2141    if (!text_end)
2142        text_end = text + strlen(text); // FIXME-OPT
2143
2144    const int text_len = (int)(text_end - text);
2145    if (text_len > 0)
2146    {
2147        // Render
2148        window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_end, wrap_width);
2149
2150        // Log as text
2151        if (g.LogEnabled)
2152            LogText(pos, text, text_end);
2153    }
2154}
2155
2156static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& clip_max)
2157{
2158    ImGuiState& g = *GImGui;
2159    ImGuiWindow* window = GetCurrentWindow();
2160
2161    // Hide anything after a '##' string
2162    const char* text_display_end = FindTextDisplayEnd(text, text_end);
2163    const int text_len = (int)(text_display_end - text);
2164    if (text_len > 0)
2165    {
2166        const ImVec2 text_size = text_size_if_known ? *text_size_if_known : ImGui::CalcTextSize(text, text_display_end, false, 0.0f);
2167
2168        // Perform CPU side clipping for single clipped element to avoid using scissor state
2169        const bool need_clipping = (pos.x + text_size.x >= clip_max.x) || (pos.y + text_size.y >= clip_max.y);
2170
2171        // Render
2172        window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, need_clipping ? &clip_max : NULL);
2173
2174        // Log as text
2175        if (g.LogEnabled)
2176            LogText(pos, text, text_display_end);
2177    }
2178}
2179
21802070// Render a rectangle shaped with optional rounding and borders
21812071static void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
21822072{
r244545r244546
22142104        b = center + ImVec2(-0.500f,0.866f)*r;
22152105        c = center + ImVec2(-0.500f,-0.866f)*r;
22162106    }
2217
2107   
22182108    if (shadow && (window->Flags & ImGuiWindowFlags_ShowBorders) != 0)
22192109        window->DrawList->AddTriangleFilled(a+ImVec2(2,2), b+ImVec2(2,2), c+ImVec2(2,2), window->Color(ImGuiCol_BorderShadow));
22202110    window->DrawList->AddTriangleFilled(a, b, c, window->Color(ImGuiCol_Border));
22212111}
22222112
22232113// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
2224// CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize)
2114// CalcTextSize("") should return ImVec2(0.0f, GImGui.FontSize)
22252115ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width)
22262116{
22272117    ImGuiWindow* window = GetCurrentWindow();
r244545r244546
22372127    ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
22382128
22392129    // Cancel out character spacing for the last character of a line (it is baked into glyph->XAdvance field)
2240    const float font_scale = font_size / font->FontSize;
2130    const float font_scale = font_size / font->FontSize;
22412131    const float character_spacing_x = 1.0f * font_scale;
22422132    if (text_size.x > 0.0f)
22432133        text_size.x -= character_spacing_x;
r244545r244546
22452135    return text_size;
22462136}
22472137
2248// Helper to calculate coarse clipping of large list of evenly sized items.
2249// If you are displaying thousands of items and you have a random access to the list, you can perform clipping yourself to save on CPU.
2250// {
2251//    float item_height = ImGui::GetTextLineHeightWithSpacing();
2252//    int display_start, display_end;
2253//    ImGui::CalcListClipping(count, item_height, &display_start, &display_end);            // calculate how many to clip/display
2254//    ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * item_height);         // advance cursor
2255//    for (int i = display_start; i < display_end; i++)                                     // display only visible items
2256//        // TODO: display visible item
2257//    ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (count - display_end) * item_height);   // advance cursor
2258// }
2259void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
2260{
2261    ImGuiState& g = *GImGui;
2262    ImGuiWindow* window = GetCurrentWindow();
2263
2264    if (g.LogEnabled)
2265    {
2266        // If logging is active, do not perform any clipping
2267        *out_items_display_start = 0;
2268        *out_items_display_end = items_count;
2269        return;
2270    }
2271
2272    const ImVec2 pos = window->DC.CursorPos;
2273    const ImVec4 clip_rect = window->ClipRectStack.back();
2274    const float clip_y1 = clip_rect.y;
2275    const float clip_y2 = clip_rect.w;
2276
2277    int start = (int)((clip_y1 - pos.y) / items_height);
2278    int end = (int)((clip_y2 - pos.y) / items_height);
2279    start = ImClamp(start, 0, items_count);
2280    end = ImClamp(end + 1, start, items_count);
2281
2282    *out_items_display_start = start;
2283    *out_items_display_end = end;
2284}
2285
22862138// Find window given position, search front-to-back
22872139static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs)
22882140{
2289    ImGuiState& g = *GImGui;
2141    ImGuiState& g = GImGui;
22902142    for (int i = (int)g.Windows.size()-1; i >= 0; i--)
22912143    {
22922144        ImGuiWindow* window = g.Windows[(size_t)i];
r244545r244546
23062158// NB- Expand the aabb to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
23072159static bool IsMouseHoveringBox(const ImGuiAabb& box)
23082160{
2309    ImGuiState& g = *GImGui;
2161    ImGuiState& g = GImGui;
23102162    ImGuiWindow* window = GetCurrentWindow();
23112163
23122164    // Clip
r244545r244546
23292181
23302182bool ImGui::IsMouseHoveringWindow()
23312183{
2332    ImGuiState& g = *GImGui;
2184    ImGuiState& g = GImGui;
23332185    ImGuiWindow* window = GetCurrentWindow();
23342186    return g.HoveredWindow == window;
23352187}
23362188
23372189bool ImGui::IsMouseHoveringAnyWindow()
23382190{
2339    ImGuiState& g = *GImGui;
2191    ImGuiState& g = GImGui;
23402192    return g.HoveredWindow != NULL;
23412193}
23422194
r244545r244546
23472199
23482200static bool IsKeyPressedMap(ImGuiKey key, bool repeat)
23492201{
2350    ImGuiState& g = *GImGui;
2202    ImGuiState& g = GImGui;
23512203    const int key_index = g.IO.KeyMap[key];
23522204    return ImGui::IsKeyPressed(key_index, repeat);
23532205}
23542206
23552207bool ImGui::IsKeyPressed(int key_index, bool repeat)
23562208{
2357    ImGuiState& g = *GImGui;
2209    ImGuiState& g = GImGui;
23582210    IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
23592211    const float t = g.IO.KeysDownTime[key_index];
23602212    if (t == 0.0f)
r244545r244546
23722224
23732225bool ImGui::IsMouseClicked(int button, bool repeat)
23742226{
2375    ImGuiState& g = *GImGui;
2227    ImGuiState& g = GImGui;
23762228    IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
23772229    const float t = g.IO.MouseDownTime[button];
23782230    if (t == 0.0f)
r244545r244546
23902242
23912243bool ImGui::IsMouseDoubleClicked(int button)
23922244{
2393    ImGuiState& g = *GImGui;
2245    ImGuiState& g = GImGui;
23942246    IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
23952247    return g.IO.MouseDoubleClicked[button];
23962248}
23972249
23982250ImVec2 ImGui::GetMousePos()
23992251{
2400    return GImGui->IO.MousePos;
2252    return GImGui.IO.MousePos;
24012253}
24022254
24032255bool ImGui::IsItemHovered()
r244545r244546
24082260
24092261bool ImGui::IsItemActive()
24102262{
2411    ImGuiState& g = *GImGui;
2263    ImGuiState& g = GImGui;
24122264    if (g.ActiveId)
24132265    {
24142266        ImGuiWindow* window = GetCurrentWindow();
r244545r244546
24322284// Tooltip is stored and turned into a BeginTooltip()/EndTooltip() sequence at the end of the frame. Each call override previous value.
24332285void ImGui::SetTooltipV(const char* fmt, va_list args)
24342286{
2435    ImGuiState& g = *GImGui;
2287    ImGuiState& g = GImGui;
24362288    ImFormatStringV(g.Tooltip, IM_ARRAYSIZE(g.Tooltip), fmt, args);
24372289}
24382290
r244545r244546
24462298
24472299float ImGui::GetTime()
24482300{
2449    return GImGui->Time;
2301    return GImGui.Time;
24502302}
24512303
24522304int ImGui::GetFrameCount()
24532305{
2454    return GImGui->FrameCount;
2306    return GImGui.FrameCount;
24552307}
24562308
24572309void ImGui::BeginTooltip()
24582310{
2459    ImGuiState& g = *GImGui;
2311    ImGuiState& g = GImGui;
24602312    ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_Tooltip;
24612313    ImGui::Begin("##Tooltip", NULL, ImVec2(0,0), g.Style.Colors[ImGuiCol_TooltipBg].w, window_flags);
24622314}
r244545r244546
24672319    ImGui::End();
24682320}
24692321
2470void ImGui::BeginChild(ImGuiID id, ImVec2 size, bool border, ImGuiWindowFlags extra_flags)
2471{
2472    char str_id[32];
2473    ImFormatString(str_id, IM_ARRAYSIZE(str_id), "child_%x", id);
2474    ImGui::BeginChild(str_id, size, border, extra_flags);
2475}
2476
24772322void ImGui::BeginChild(const char* str_id, ImVec2 size, bool border, ImGuiWindowFlags extra_flags)
24782323{
2479    ImGuiState& g = *GImGui;
2324    ImGuiState& g = GImGui;
24802325    ImGuiWindow* window = GetCurrentWindow();
24812326
24822327    ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
r244545r244546
25022347    char title[256];
25032348    ImFormatString(title, IM_ARRAYSIZE(title), "%s.%s", window->Name, str_id);
25042349
2505    const float alpha = 1.0f;
2350    const float alpha = (flags & ImGuiWindowFlags_ComboBox) ? 1.0f : 0.0f;
25062351    ImGui::Begin(title, NULL, size, alpha, flags);
25072352
25082353    if (!(window->Flags & ImGuiWindowFlags_ShowBorders))
r244545r244546
25262371            sz.x = 0;
25272372        if (window->Flags & ImGuiWindowFlags_ChildWindowAutoFitY)
25282373            sz.y = 0;
2529
2374       
25302375        ImGui::End();
25312376        ItemSize(sz);
25322377    }
25332378}
25342379
2535// Helper to create a child window / scrolling region that looks like a normal widget frame.
2536void ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size)
2537{
2538    ImGuiState& g = *GImGui;
2539    const ImGuiStyle& style = g.Style;
2540    ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, style.Colors[ImGuiCol_FrameBg]);
2541    ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, style.FrameRounding);
2542    ImGui::BeginChild(id, size);
2543}
2544
2545void ImGui::EndChildFrame()
2546{
2547    ImGui::EndChild();
2548    ImGui::PopStyleVar();
2549    ImGui::PopStyleColor();
2550}
2551
25522380static ImGuiWindow* FindWindowByName(const char* name)
25532381{
25542382    // FIXME-OPT: Consider optimizing this (e.g. sorted hashes to window pointers)
2555    ImGuiState& g = *GImGui;
2383    ImGuiState& g = GImGui;
25562384    for (size_t i = 0; i != g.Windows.size(); i++)
25572385        if (strcmp(g.Windows[i]->Name, name) == 0)
25582386            return g.Windows[i];
r244545r244546
25612389
25622390static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags)
25632391{
2564    ImGuiState& g = *GImGui;
2392    ImGuiState& g = GImGui;
25652393
25662394    // Create window the first time
25672395    ImGuiWindow* window = (ImGuiWindow*)ImGui::MemAlloc(sizeof(ImGuiWindow));
r244545r244546
26072435    return window;
26082436}
26092437
2610// Push a new ImGui window to add widgets to.
2438// Push a new ImGui window to add widgets to.
26112439// - A default window called "Debug" is automatically stacked at the beginning of every frame.
26122440// - This can be called multiple times during the frame with the same window name to append content to the same window.
26132441// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). Note that you can use ## to append unique data that isn't displayed, e.g. "My window##1" will use "My window##1" as unique window ID but display "My window" to the user.
r244545r244546
26162444// - Passing non-zero 'size' is roughly equivalent to calling SetNextWindowSize(size, ImGuiSetCondition_FirstUseEver) prior to calling Begin().
26172445bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alpha, ImGuiWindowFlags flags)
26182446{
2619    ImGuiState& g = *GImGui;
2447    ImGuiState& g = GImGui;
26202448    const ImGuiStyle& style = g.Style;
26212449    IM_ASSERT(g.Initialized);                       // Forgot to call ImGui::NewFrame()
26222450    IM_ASSERT(name != NULL);                        // Must pass a name
r244545r244546
27842612        // Collapse window by double-clicking on title bar
27852613        if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
27862614        {
2787            if (!(window->Flags & ImGuiWindowFlags_NoCollapse) && g.HoveredWindow == window && IsMouseHoveringBox(title_bar_aabb) && g.IO.MouseDoubleClicked[0])
2615            if (g.HoveredWindow == window && IsMouseHoveringBox(title_bar_aabb) && g.IO.MouseDoubleClicked[0])
27882616            {
27892617                window->Collapsed = !window->Collapsed;
27902618                if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings))
r244545r244546
27972625            window->Collapsed = false;
27982626        }
27992627
2800        const float window_rounding = (window->Flags & ImGuiWindowFlags_ChildWindow) ? style.ChildWindowRounding : style.WindowRounding;
28012628        if (window->Collapsed)
28022629        {
28032630            // Draw title bar only
28042631            window->Size = title_bar_aabb.GetSize();
2805            window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBgCollapsed), window_rounding);
2632            window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBgCollapsed), style.WindowRounding);
28062633            if (window->Flags & ImGuiWindowFlags_ShowBorders)
28072634            {
2808                window->DrawList->AddRect(title_bar_aabb.GetTL()+ImVec2(1,1), title_bar_aabb.GetBR()+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), window_rounding);
2809                window->DrawList->AddRect(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border), window_rounding);
2635                window->DrawList->AddRect(title_bar_aabb.GetTL()+ImVec2(1,1), title_bar_aabb.GetBR()+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), style.WindowRounding);
2636                window->DrawList->AddRect(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border), style.WindowRounding);
28102637            }
28112638        }
28122639        else
r244545r244546
28692696                title_bar_aabb = window->TitleBarAabb();
28702697            }
28712698
2872            // Scrollbar
2873            window->ScrollbarY = (window->SizeContentsFit.y > window->Size.y) && !(window->Flags & ImGuiWindowFlags_NoScrollbar);
2874
2875            // Window background
2699            // Title bar + Window box
28762700            if (fill_alpha > 0.0f)
28772701            {
28782702                if ((window->Flags & ImGuiWindowFlags_ComboBox) != 0)
2879                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ComboBg, fill_alpha), window_rounding);
2703                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ComboBg, fill_alpha), 0);
28802704                else if ((window->Flags & ImGuiWindowFlags_Tooltip) != 0)
2881                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_TooltipBg, fill_alpha), window_rounding);
2882                else if ((window->Flags & ImGuiWindowFlags_ChildWindow) != 0)
2883                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size-ImVec2(window->ScrollbarY?style.ScrollBarWidth:0.0f,0.0f), window->Color(ImGuiCol_ChildWindowBg, fill_alpha), window_rounding, window->ScrollbarY ? (1|8) : (0xF));
2705                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_TooltipBg, fill_alpha), style.WindowRounding);
28842706                else
2885                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, fill_alpha), window_rounding);
2707                    window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, fill_alpha), style.WindowRounding);
28862708            }
28872709
2888            // Title bar
28892710            if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
2890                window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBg), window_rounding, 1|2);
2711                window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBg), style.WindowRounding, 1|2);
28912712
28922713            // Borders
28932714            if (window->Flags & ImGuiWindowFlags_ShowBorders)
28942715            {
2895                window->DrawList->AddRect(window->Pos+ImVec2(1,1), window->Pos+window->Size+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), window_rounding);
2896                window->DrawList->AddRect(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_Border), window_rounding);
2716                const float rounding = (window->Flags & ImGuiWindowFlags_ComboBox) ? 0.0f : style.WindowRounding;
2717                window->DrawList->AddRect(window->Pos+ImVec2(1,1), window->Pos+window->Size+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), rounding);
2718                window->DrawList->AddRect(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_Border), rounding);
28972719                if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
28982720                    window->DrawList->AddLine(title_bar_aabb.GetBL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border));
28992721            }
29002722
29012723            // Scrollbar
2724            window->ScrollbarY = (window->SizeContentsFit.y > window->Size.y) && !(window->Flags & ImGuiWindowFlags_NoScrollbar);
29022725            if (window->ScrollbarY)
29032726            {
29042727                ImGuiAabb scrollbar_bb(window->Aabb().Max.x - style.ScrollBarWidth, title_bar_aabb.Max.y+1, window->Aabb().Max.x, window->Aabb().Max.y-1);
r244545r244546
29202743                    {
29212744                        g.HoveredId = scrollbar_id;
29222745                        const float pos_y_norm = ImSaturate((g.IO.MousePos.y - (scrollbar_bb.Min.y + grab_size_y*0.5f)) / (scrollbar_bb.GetHeight() - grab_size_y)) * (1.0f - grab_size_y_norm);
2923                        window->ScrollY = (float)(int)(pos_y_norm * window->SizeContentsFit.y);
2746                        window->ScrollY = pos_y_norm * window->SizeContentsFit.y;
29242747                        window->NextScrollY = window->ScrollY;
29252748                    }
29262749                }
r244545r244546
29292752                const float pos_y_norm = ImSaturate(window->ScrollY / ImMax(0.0f, window->SizeContentsFit.y));
29302753                const ImU32 grab_col = window->Color(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab);
29312754                window->DrawList->AddRectFilled(
2932                    ImVec2(scrollbar_bb.Min.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm)),
2755                    ImVec2(scrollbar_bb.Min.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm)),
29332756                    ImVec2(scrollbar_bb.Max.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm + grab_size_y_norm)), grab_col);
29342757            }
29352758
r244545r244546
29372760            // (after the input handling so we don't have a frame of latency)
29382761            if (!(window->Flags & ImGuiWindowFlags_NoResize))
29392762            {
2940                const float r = window_rounding;
2763                const float r = style.WindowRounding;
29412764                const ImVec2 br = window->Aabb().GetBR();
29422765                if (r == 0.0f)
29432766                {
r244545r244546
29622785        window->DC.CurrentLineHeight = window->DC.PrevLineHeight = 0.0f;
29632786        window->DC.LogLineHeight = window->DC.CursorPos.y - 9999.0f;
29642787        window->DC.ChildWindows.resize(0);
2965        window->DC.ItemWidth.resize(0);
2788        window->DC.ItemWidth.resize(0);
29662789        window->DC.ItemWidth.push_back(window->ItemWidthDefault);
29672790        window->DC.AllowKeyboardFocus.resize(0);
29682791        window->DC.AllowKeyboardFocus.push_back(true);
r244545r244546
29852808        // Title bar
29862809        if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
29872810        {
2811            RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true);
29882812            if (p_opened != NULL)
29892813                CloseWindowButton(p_opened);
29902814
2991            ImVec2 text_min = window->Pos + style.FramePadding;
2992            if (!(window->Flags & ImGuiWindowFlags_NoCollapse))
2993            {
2994                RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true);
2995                text_min.x += window->FontSize() + style.ItemInnerSpacing.x;
2996            }
2997
29982815            const ImVec2 text_size = CalcTextSize(name, NULL, true);
2999            const ImVec2 text_max = window->Pos + ImVec2(window->Size.x - (p_opened ? (title_bar_aabb.GetHeight()-3) : style.FramePadding.x), style.FramePadding.y*2 + text_size.y);
3000            RenderTextClipped(text_min, name, NULL, &text_size, text_max);
2816            const ImVec2 text_min = window->Pos + style.FramePadding + ImVec2(window->FontSize() + style.ItemInnerSpacing.x, 0.0f);
2817            const ImVec2 text_max = window->Pos + ImVec2(window->Size.x - (p_opened ? (title_bar_aabb.GetHeight()-3) : style.FramePadding.x), style.FramePadding.y + text_size.y);
2818            const bool clip_title = text_size.x > (text_max.x - text_min.x);    // only push a clip rectangle if we need to, because it may turn into a separate draw call
2819            if (clip_title)
2820                PushClipRect(ImVec4(text_min.x, text_min.y, text_max.x, text_max.y));
2821            RenderText(text_min, name);
2822            if (clip_title)
2823                PopClipRect();
30012824        }
30022825    }
30032826
r244545r244546
30362859
30372860void ImGui::End()
30382861{
3039    ImGuiState& g = *GImGui;
2862    ImGuiState& g = GImGui;
30402863    ImGuiWindow* window = g.CurrentWindow;
30412864
30422865    ImGui::Columns(1, "#CloseColumns");
r244545r244546
30572880// Moving window to front of display (which happens to be back of our sorted list)
30582881static void FocusWindow(ImGuiWindow* window)
30592882{
3060    ImGuiState& g = *GImGui;
2883    ImGuiState& g = GImGui;
30612884    g.FocusedWindow = window;
30622885
30632886    if (g.Windows.back() == window)
r244545r244546
30752898void ImGui::PushItemWidth(float item_width)
30762899{
30772900    ImGuiWindow* window = GetCurrentWindow();
3078    window->DC.ItemWidth.push_back(item_width == 0.0f ? window->ItemWidthDefault : item_width);
2901    item_width = (float)(int)item_width;
2902    window->DC.ItemWidth.push_back(item_width > 0.0f ? item_width : window->ItemWidthDefault);
30792903}
30802904
30812905void ImGui::PopItemWidth()
r244545r244546
30842908    window->DC.ItemWidth.pop_back();
30852909}
30862910
3087float ImGui::CalcItemWidth()
2911float ImGui::GetItemWidth()
30882912{
30892913    ImGuiWindow* window = GetCurrentWindow();
3090    float w = window->DC.ItemWidth.back();
3091    if (w < 0.0f)
3092    {
3093        // Align to a right-side limit. We include 1 frame padding in the calculation because this is how the width is always used (we add 2 frame padding to it), but we could move that responsibility to the widget as well.
3094        ImGuiState& g = *GImGui;
3095        w = -w;
3096        float width_to_right_edge = window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x;
3097        w = ImMax(1.0f, width_to_right_edge - w - g.Style.FramePadding.x * 2.0f);
3098    }
3099    w = (float)(int)w;
3100    return w;
2914    return window->DC.ItemWidth.back();
31012915}
31022916
31032917static void SetFont(ImFont* font)
31042918{
3105    ImGuiState& g = *GImGui;
2919    ImGuiState& g = GImGui;
31062920
31072921    IM_ASSERT(font && font->IsLoaded());
31082922    IM_ASSERT(font->Scale > 0.0f);
r244545r244546
31152929
31162930void ImGui::PushFont(ImFont* font)
31172931{
3118    ImGuiState& g = *GImGui;
2932    ImGuiState& g = GImGui;
31192933
31202934    if (!font)
31212935        font = g.IO.Fonts->Fonts[0];
r244545r244546
31272941
31282942void  ImGui::PopFont()
31292943{
3130    ImGuiState& g = *GImGui;
2944    ImGuiState& g = GImGui;
31312945
31322946    g.CurrentWindow->DrawList->PopTextureID();
31332947    g.FontStack.pop_back();
r244545r244546
31602974
31612975void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
31622976{
3163    ImGuiState& g = *GImGui;
2977    ImGuiState& g = GImGui;
31642978
31652979    ImGuiColMod backup;
31662980    backup.Col = idx;
r244545r244546
31712985
31722986void ImGui::PopStyleColor(int count)
31732987{
3174    ImGuiState& g = *GImGui;
2988    ImGuiState& g = GImGui;
31752989
31762990    while (count > 0)
31772991    {
r244545r244546
31842998
31852999static float* GetStyleVarFloatAddr(ImGuiStyleVar idx)
31863000{
3187    ImGuiState& g = *GImGui;
3001    ImGuiState& g = GImGui;
31883002    switch (idx)
31893003    {
31903004    case ImGuiStyleVar_Alpha: return &g.Style.Alpha;
31913005    case ImGuiStyleVar_WindowRounding: return &g.Style.WindowRounding;
3192    case ImGuiStyleVar_ChildWindowRounding: return &g.Style.ChildWindowRounding;
31933006    case ImGuiStyleVar_FrameRounding: return &g.Style.FrameRounding;
31943007    case ImGuiStyleVar_TreeNodeSpacing: return &g.Style.TreeNodeSpacing;
31953008    }
r244545r244546
31983011
31993012static ImVec2* GetStyleVarVec2Addr(ImGuiStyleVar idx)
32003013{
3201    ImGuiState& g = *GImGui;
3014    ImGuiState& g = GImGui;
32023015    switch (idx)
32033016    {
32043017    case ImGuiStyleVar_WindowPadding: return &g.Style.WindowPadding;
r244545r244546
32113024
32123025void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
32133026{
3214    ImGuiState& g = *GImGui;
3027    ImGuiState& g = GImGui;
32153028
32163029    float* pvar = GetStyleVarFloatAddr(idx);
32173030    IM_ASSERT(pvar != NULL); // Called function with wrong-type? Variable is not a float.
r244545r244546
32253038
32263039void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
32273040{
3228    ImGuiState& g = *GImGui;
3041    ImGuiState& g = GImGui;
32293042
32303043    ImVec2* pvar = GetStyleVarVec2Addr(idx);
32313044    IM_ASSERT(pvar != NULL); // Called function with wrong-type? Varialble is not a ImVec2.
r244545r244546
32383051
32393052void ImGui::PopStyleVar(int count)
32403053{
3241    ImGuiState& g = *GImGui;
3054    ImGuiState& g = GImGui;
32423055
32433056    while (count > 0)
32443057    {
r244545r244546
32593072    {
32603073    case ImGuiCol_Text: return "Text";
32613074    case ImGuiCol_WindowBg: return "WindowBg";
3262    case ImGuiCol_ChildWindowBg: return "ChildWindowBg";
32633075    case ImGuiCol_Border: return "Border";
32643076    case ImGuiCol_BorderShadow: return "BorderShadow";
32653077    case ImGuiCol_FrameBg: return "FrameBg";
r244545r244546
33033115
33043116bool ImGui::GetWindowIsFocused()
33053117{
3306    ImGuiState& g = *GImGui;
3118    ImGuiState& g = GImGui;
33073119    ImGuiWindow* window = GetCurrentWindow();
33083120    return g.FocusedWindow == window;
33093121}
r244545r244546
33803192
33813193void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiSetCondition cond)
33823194{
3383    ImGuiState& g = *GImGui;
3195    ImGuiState& g = GImGui;
33843196    g.SetNextWindowPosVal = pos;
33853197    g.SetNextWindowPosCond = cond ? cond : ImGuiSetCondition_Always;
33863198}
33873199
33883200void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond)
33893201{
3390    ImGuiState& g = *GImGui;
3202    ImGuiState& g = GImGui;
33913203    g.SetNextWindowSizeVal = size;
33923204    g.SetNextWindowSizeCond = cond ? cond : ImGuiSetCondition_Always;
33933205}
33943206
33953207void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
33963208{
3397    ImGuiState& g = *GImGui;
3209    ImGuiState& g = GImGui;
33983210    g.SetNextWindowCollapsedVal = collapsed;
33993211    g.SetNextWindowCollapsedCond = cond ? cond : ImGuiSetCondition_Always;
34003212}
r244545r244546
34023214ImVec2 ImGui::GetContentRegionMax()
34033215{
34043216    ImGuiWindow* window = GetCurrentWindow();
3405    ImVec2 mx = window->Size - window->WindowPadding();
3217
3218    ImVec2 m = window->Size - window->WindowPadding();
34063219    if (window->DC.ColumnsCount != 1)
34073220    {
3408        mx.x = ImGui::GetColumnOffset(window->DC.ColumnsCurrent + 1);
3409        mx.x -= GImGui->Style.WindowPadding.x;
3221        m.x = GetColumnOffset(window->DC.ColumnsCurrent + 1);
3222        m.x -= GImGui.Style.WindowPadding.x;
34103223    }
34113224    else
34123225    {
34133226        if (window->ScrollbarY)
3414            mx.x -= GImGui->Style.ScrollBarWidth;
3227            m.x -= GImGui.Style.ScrollBarWidth;
34153228    }
3416    return mx;
3229
3230    return m;
34173231}
34183232
34193233ImVec2 ImGui::GetWindowContentRegionMin()
r244545r244546
34273241    ImGuiWindow* window = GetCurrentWindow();
34283242    ImVec2 m = window->Size - window->WindowPadding();
34293243    if (window->ScrollbarY)
3430        m.x -= GImGui->Style.ScrollBarWidth;
3244        m.x -= GImGui.Style.ScrollBarWidth;
34313245    return m;
34323246}
34333247
r244545r244546
34373251    return window->FontSize();
34383252}
34393253
3440float ImGui::GetTextLineHeightWithSpacing()
3254float ImGui::GetTextLineSpacing()
34413255{
3442    ImGuiState& g = *GImGui;
3256    ImGuiState& g = GImGui;
34433257    ImGuiWindow* window = GetCurrentWindow();
34443258    return window->FontSize() + g.Style.ItemSpacing.y;
34453259}
r244545r244546
34763290    return window->DC.CursorPos - window->Pos;
34773291}
34783292
3479float ImGui::GetCursorPosX()
3480{
3481    return ImGui::GetCursorPos().x;
3482}
3483
3484float ImGui::GetCursorPosY()
3485{
3486    return ImGui::GetCursorPos().y;
3487}
3488
34893293void ImGui::SetCursorPos(const ImVec2& pos)
34903294{
34913295    ImGuiWindow* window = GetCurrentWindow();
34923296    window->DC.CursorPos = window->Pos + pos;
3493    window->SizeContentsFit = ImMax(window->SizeContentsFit, pos + ImVec2(0.0f, window->ScrollY));
34943297}
34953298
34963299void ImGui::SetCursorPosX(float x)
34973300{
34983301    ImGuiWindow* window = GetCurrentWindow();
34993302    window->DC.CursorPos.x = window->Pos.x + x;
3500    window->SizeContentsFit.x = ImMax(window->SizeContentsFit.x, x);
35013303}
35023304
35033305void ImGui::SetCursorPosY(float y)
35043306{
35053307    ImGuiWindow* window = GetCurrentWindow();
35063308    window->DC.CursorPos.y = window->Pos.y + y;
3507    window->SizeContentsFit.y = ImMax(window->SizeContentsFit.y, y + window->ScrollY);
35083309}
35093310
35103311ImVec2 ImGui::GetCursorScreenPos()
r244545r244546
35953396
35963397void ImGui::TextUnformatted(const char* text, const char* text_end)
35973398{
3598    ImGuiState& g = *GImGui;
3399    ImGuiState& g = GImGui;
35993400    ImGuiWindow* window = GetCurrentWindow();
36003401    if (window->SkipItems)
36013402        return;
r244545r244546
36113412    {
36123413        // Long text!
36133414        // Perform manual coarse clipping to optimize for long multi-line text
3614        // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled.
3615        // We also don't vertically center the text within the line full height, which is unlikely to matter because we are likely the biggest and only item on the line.
3415        // From this point we will only compute the width of lines that are visible.
3416        // Optimization only available when word-wrapping is disabled.
36163417        const char* line = text;
36173418        const float line_height = ImGui::GetTextLineHeight();
36183419        const ImVec2 start_pos = window->DC.CursorPos;
r244545r244546
36893490        if (!ItemAdd(bb, NULL))
36903491            return;
36913492
3692        // Render (we don't hide text after ## in this end-user function)
3693        RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width);
3493        // Render
3494        // We don't hide text after ## in this end-user function.
3495        RenderText(bb.Min, text_begin, text_end, false, wrap_width);
36943496    }
36953497}
36963498
36973499void ImGui::AlignFirstTextHeightToWidgets()
36983500{
3699    ImGuiState& g = *GImGui;
3501    ImGuiState& g = GImGui;
37003502    ImGuiWindow* window = GetCurrentWindow();
37013503    if (window->SkipItems)
37023504        return;
r244545r244546
37093511// Add a label+text combo aligned to other label+value widgets
37103512void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
37113513{
3712    ImGuiState& g = *GImGui;
3514    ImGuiState& g = GImGui;
37133515    ImGuiWindow* window = GetCurrentWindow();
37143516    if (window->SkipItems)
37153517        return;
37163518    const ImGuiStyle& style = g.Style;
3717    const float w = ImGui::CalcItemWidth();
3519    const float w = window->DC.ItemWidth.back();
37183520
37193521    static char buf[1024];
3720    const char* value_text_begin = &buf[0];
3721    const char* value_text_end = value_text_begin + ImFormatStringV(buf, IM_ARRAYSIZE(buf), fmt, args);
3522    const char* text_begin = &buf[0];
3523    const char* text_end = text_begin + ImFormatStringV(buf, IM_ARRAYSIZE(buf), fmt, args);
37223524
37233525    const ImVec2 text_size = CalcTextSize(label, NULL, true);
37243526    const ImGuiAabb value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + style.FramePadding.x*2, text_size.y));
r244545r244546
37283530        return;
37293531
37303532    // Render
3731    RenderTextClipped(value_bb.Min, value_text_begin, value_text_end, NULL, value_bb.Max);
3533    RenderText(value_bb.Min, text_begin, text_end);
37323534    RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y), label);
37333535}
37343536
r244545r244546
37423544
37433545static bool IsHovered(const ImGuiAabb& bb, const ImGuiID& id)
37443546{
3745    ImGuiState& g = *GImGui;
3547    ImGuiState& g = GImGui;
37463548    if (g.HoveredId == 0)
37473549    {
37483550        ImGuiWindow* window = GetCurrentWindow();
r244545r244546
37523554    return false;
37533555}
37543556
3755static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat, bool pressed_on_click)
3557static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat)
37563558{
3757    ImGuiState& g = *GImGui;
3559    ImGuiState& g = GImGui;
37583560    ImGuiWindow* window = GetCurrentWindow();
37593561
37603562    const bool hovered = IsHovered(bb, id);
r244545r244546
37663568        {
37673569            if (g.IO.MouseClicked[0])
37683570            {
3769                if (pressed_on_click)
3770                {
3771                    pressed = true;
3772                    SetActiveId(0);
3773                }
3774                else
3775                {
3776                    SetActiveId(id);
3777                }
3571                SetActiveId(id);
37783572                FocusWindow(window);
37793573            }
37803574            else if (repeat && g.ActiveId && ImGui::IsMouseClicked(0, true))
r244545r244546
38073601
38083602bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_held)
38093603{
3810    ImGuiState& g = *GImGui;
3604    ImGuiState& g = GImGui;
38113605    ImGuiWindow* window = GetCurrentWindow();
38123606    if (window->SkipItems)
38133607        return false;
r244545r244546
38173611    const ImVec2 text_size = CalcTextSize(label, NULL, true);
38183612
38193613    const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : text_size.x, size_arg.y != 0.0f ? size_arg.y : text_size.y);
3614
38203615    const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + style.FramePadding*2.0f);
38213616    ItemSize(bb);
38223617    if (!ItemAdd(bb, &id))
r244545r244546
38293624    const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
38303625    RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
38313626
3832    const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);  // Center (only applies if we explicitly gave a size bigger than the text size, which isn't the common path)
3833    RenderTextClipped(bb.Min + style.FramePadding + off, label, NULL, &text_size, bb.Max);                          // Render clip (only applies if we explicitly gave a size smaller than the text size, which isn't the commmon path)
3627    if (size.x < text_size.x || size.y < text_size.y)
3628        PushClipRect(ImVec4(bb.Min.x+style.FramePadding.x, bb.Min.y+style.FramePadding.y, bb.Max.x, bb.Max.y-style.FramePadding.y));        // Allow extra to draw over the horizontal padding to make it visible that text doesn't fit
3629    const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);
3630    RenderText(bb.Min + style.FramePadding + off, label);
3631    if (size.x < text_size.x || size.y < text_size.y)
3632        PopClipRect();
38343633
38353634    return pressed;
38363635}
r244545r244546
38383637// Small buttons fits within text without additional spacing.
38393638bool ImGui::SmallButton(const char* label)
38403639{
3841    ImGuiState& g = *GImGui;
3640    ImGuiState& g = GImGui;
38423641    ImGuiWindow* window = GetCurrentWindow();
38433642    if (window->SkipItems)
38443643        return false;
r244545r244546
39413740// frame_padding = 0: no framing
39423741// frame_padding > 0: set framing size
39433742// The color used are the button colors.
3944bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
3743bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col)
39453744{
3946    ImGuiState& g = *GImGui;
3745    ImGuiState& g = GImGui;
39473746    ImGuiWindow* window = GetCurrentWindow();
39483747    if (window->SkipItems)
39493748        return false;
r244545r244546
39583757
39593758    const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding;
39603759    const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2);
3961    const ImGuiAabb image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
3760    const ImGuiAabb image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
39623761    ItemSize(bb);
39633762    if (!ItemAdd(bb, &id))
39643763        return false;
r244545r244546
39723771        RenderFrame(bb.Min, bb.Max, col);
39733772    if (bg_col.w > 0.0f)
39743773        window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, window->Color(bg_col));
3975    window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, window->Color(tint_col));
3774    window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1);
39763775
39773776    return pressed;
39783777}
r244545r244546
39803779// Start logging ImGui output to TTY
39813780void ImGui::LogToTTY(int max_depth)
39823781{
3983    ImGuiState& g = *GImGui;
3782    ImGuiState& g = GImGui;
39843783    ImGuiWindow* window = GetCurrentWindow();
39853784    if (g.LogEnabled)
39863785        return;
r244545r244546
39953794// Start logging ImGui output to given file
39963795void ImGui::LogToFile(int max_depth, const char* filename)
39973796{
3998    ImGuiState& g = *GImGui;
3797    ImGuiState& g = GImGui;
39993798    ImGuiWindow* window = GetCurrentWindow();
40003799    if (g.LogEnabled)
40013800        return;
r244545r244546
40183817void ImGui::LogToClipboard(int max_depth)
40193818{
40203819    ImGuiWindow* window = GetCurrentWindow();
4021    ImGuiState& g = *GImGui;
3820    ImGuiState& g = GImGui;
40223821    if (g.LogEnabled)
40233822        return;
40243823
r244545r244546
40313830
40323831void ImGui::LogFinish()
40333832{
4034    ImGuiState& g = *GImGui;
3833    ImGuiState& g = GImGui;
40353834    if (!g.LogEnabled)
40363835        return;
40373836
r244545r244546
40563855// Helper to display logging buttons
40573856void ImGui::LogButtons()
40583857{
4059    ImGuiState& g = *GImGui;
3858    ImGuiState& g = GImGui;
40603859
40613860    ImGui::PushID("LogButtons");
40623861    const bool log_to_tty = ImGui::Button("Log To TTY");
4063    ImGui::SameLine();
3862    ImGui::SameLine();     
40643863    const bool log_to_file = ImGui::Button("Log To File");
40653864    ImGui::SameLine();
40663865    const bool log_to_clipboard = ImGui::Button("Log To Clipboard");
r244545r244546
40843883
40853884bool ImGui::CollapsingHeader(const char* label, const char* str_id, const bool display_frame, const bool default_open)
40863885{
4087    ImGuiState& g = *GImGui;
3886    ImGuiState& g = GImGui;
40883887    ImGuiWindow* window = GetCurrentWindow();
40893888    if (window->SkipItems)
40903889        return false;
r244545r244546
41303929
41313930    // When logging is enabled, if automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behaviour).
41323931    // NB- If we are above max depth we still allow manually opened nodes to be logged.
4133    if (!display_frame)
3932    if (!display_frame)
41343933        if (g.LogEnabled && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
41353934            opened = true;
41363935
r244545r244546
41823981// Text with a little bullet aligned to the typical tree node.
41833982void ImGui::BulletTextV(const char* fmt, va_list args)
41843983{
4185    ImGuiState& g = *GImGui;
3984    ImGuiState& g = GImGui;
41863985    ImGuiWindow* window = GetCurrentWindow();
41873986    if (window->SkipItems)
41883987        return;
4189
3988   
41903989    const ImGuiStyle& style = g.Style;
41913990
41923991    static char buf[1024];
r244545r244546
43434142
43444143    float ref_v = *v;
43454144    if (op)
4346        if (sscanf(GImGui->InputTextState.InitialText, "%f", &ref_v) < 1)
4145        if (sscanf(GImGui.InputTextState.InitialText, "%f", &ref_v) < 1)
43474146            return;
43484147
43494148    float op_v = 0.0f;
r244545r244546
43684167// Adjust display_format to decorate the value with a prefix or a suffix.
43694168bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power)
43704169{
4371    ImGuiState& g = *GImGui;
4170    ImGuiState& g = GImGui;
43724171    ImGuiWindow* window = GetCurrentWindow();
43734172    if (window->SkipItems)
43744173        return false;
43754174
43764175    const ImGuiStyle& style = g.Style;
43774176    const ImGuiID id = window->GetID(label);
4378    const float w = ImGui::CalcItemWidth();
4177    const float w = window->DC.ItemWidth.back();
43794178
43804179    if (!display_format)
43814180        display_format = "%.3f";
r244545r244546
45044303            if (!is_unbound)
45054304            {
45064305                const float normalized_pos = ImClamp((g.IO.MousePos.x - slider_effective_x1) / slider_effective_w, 0.0f, 1.0f);
4507
4306               
45084307                // Linear slider
45094308                //float new_value = ImLerp(v_min, v_max, normalized_pos);
45104309
r244545r244546
46084407// Add multiple sliders on 1 line for compact edition of multiple components
46094408static bool SliderFloatN(const char* label, float v[3], int components, float v_min, float v_max, const char* display_format, float power)
46104409{
4611    ImGuiState& g = *GImGui;
4410    ImGuiState& g = GImGui;
46124411    ImGuiWindow* window = GetCurrentWindow();
46134412    if (window->SkipItems)
46144413        return false;
46154414
46164415    const ImGuiStyle& style = g.Style;
4617    const float w_full = ImGui::CalcItemWidth();
4416    const float w_full = window->DC.ItemWidth.back();
46184417    const float w_item_one  = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)) / (float)components));
46194418    const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)));
46204419
r244545r244546
46584457
46594458static bool SliderIntN(const char* label, int v[3], int components, int v_min, int v_max, const char* display_format)
46604459{
4661    ImGuiState& g = *GImGui;
4460    ImGuiState& g = GImGui;
46624461    ImGuiWindow* window = GetCurrentWindow();
46634462    if (window->SkipItems)
46644463        return false;
46654464
46664465    const ImGuiStyle& style = g.Style;
4667    const float w_full = ImGui::CalcItemWidth();
4466    const float w_full = window->DC.ItemWidth.back();
46684467    const float w_item_one  = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)) / (float)components));
46694468    const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)));
46704469
r244545r244546
47144513
47154514static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size)
47164515{
4717    ImGuiState& g = *GImGui;
4516    ImGuiState& g = GImGui;
47184517    ImGuiWindow* window = GetCurrentWindow();
47194518    if (window->SkipItems)
47204519        return;
r244545r244546
47234522
47244523    const ImVec2 text_size = ImGui::CalcTextSize(label, NULL, true);
47254524    if (graph_size.x == 0.0f)
4726        graph_size.x = ImGui::CalcItemWidth();
4525        graph_size.x = window->DC.ItemWidth.back();
47274526    if (graph_size.y == 0.0f)
47284527        graph_size.y = text_size.y;
47294528
r244545r244546
47644563        const float t = ImClamp((g.IO.MousePos.x - graph_bb.Min.x) / (graph_bb.Max.x - graph_bb.Min.x), 0.0f, 0.9999f);
47654564        const int v_idx = (int)(t * (values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0)));
47664565        IM_ASSERT(v_idx >= 0 && v_idx < values_count);
4767
4566       
47684567        const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
47694568        const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
47704569        if (plot_type == ImGuiPlotType_Lines)
r244545r244546
48474646
48484647bool ImGui::Checkbox(const char* label, bool* v)
48494648{
4850    ImGuiState& g = *GImGui;
4649    ImGuiState& g = GImGui;
48514650    ImGuiWindow* window = GetCurrentWindow();
48524651    if (window->SkipItems)
48534652        return false;
r244545r244546
49054704
49064705bool ImGui::RadioButton(const char* label, bool active)
49074706{
4908    ImGuiState& g = *GImGui;
4707    ImGuiState& g = GImGui;
49094708    ImGuiWindow* window = GetCurrentWindow();
49104709    if (window->SkipItems)
49114710        return false;
r244545r244546
50364835#endif
50374836
50384837void ImGuiTextEditState::OnKeyPressed(int key)
5039{
5040    stb_textedit_key(this, &StbState, key);
5041    CursorAnimReset();
4838{
4839    stb_textedit_key(this, &StbState, key);
4840    CursorAnimReset();
50424841}
50434842
50444843void ImGuiTextEditState::UpdateScrollOffset()
r244545r244546
50474846    const float scroll_x_increment = Width * 0.25f;
50484847    const float cursor_offset_x = Font->CalcTextSizeW(FontSize, FLT_MAX, Text, Text+StbState.cursor, NULL).x;
50494848    if (ScrollX > cursor_offset_x)
5050        ScrollX = ImMax(0.0f, cursor_offset_x - scroll_x_increment);
4849        ScrollX = ImMax(0.0f, cursor_offset_x - scroll_x_increment);   
50514850    else if (ScrollX < cursor_offset_x - Width)
50524851        ScrollX = cursor_offset_x - Width + scroll_x_increment;
50534852}
r244545r244546
51034902    const float clip_end = (text_end[0] != '\0' && text_end > text_start) ? symbol_w : 0.0f;
51044903
51054904    // Draw text
5106    RenderText(pos+ImVec2(clip_begin,0), text_start+(clip_begin>0.0f?1:0), text_end-(clip_end>0.0f?1:0), false);
4905    RenderText(pos+ImVec2(clip_begin,0), text_start+(clip_begin>0.0f?1:0), text_end-(clip_end>0.0f?1:0), false);//, &text_params_with_clipping);
51074906
51084907    // Draw the clip symbol
51094908    const char s[2] = {symbol_c,'\0'};
r244545r244546
51154914
51164915bool ImGui::InputFloat(const char* label, float *v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags)
51174916{
5118    ImGuiState& g = *GImGui;
4917    ImGuiState& g = GImGui;
51194918    ImGuiWindow* window = GetCurrentWindow();
51204919    if (window->SkipItems)
51214920        return false;
51224921
51234922    const ImGuiStyle& style = g.Style;
5124    const float w = ImGui::CalcItemWidth();
4923    const float w = window->DC.ItemWidth.back();
51254924    const ImVec2 text_size = CalcTextSize(label, NULL, true);
51264925    const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
51274926
r244545r244546
52275026    if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF)))
52285027        return true;
52295028
5230    if (c >= 0xE000 && c <= 0xF8FF) // Filter private Unicode range. I don't imagine anybody would want to input them. GLFW on OSX seems to send private characters for special keys like arrow keys.
5231        return true;
5232
52335029    if (flags & ImGuiInputTextFlags_CharsDecimal)
52345030        if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/'))
52355031            return true;
r244545r244546
52445040// Edit a string of text
52455041bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, void (*callback)(ImGuiTextEditCallbackData*), void* user_data)
52465042{
5247    ImGuiState& g = *GImGui;
5043    ImGuiState& g = GImGui;
52485044    ImGuiWindow* window = GetCurrentWindow();
52495045    if (window->SkipItems)
52505046        return false;
r244545r244546
52535049    const ImGuiStyle& style = g.Style;
52545050
52555051    const ImGuiID id = window->GetID(label);
5256    const float w = ImGui::CalcItemWidth();
5052    const float w = window->DC.ItemWidth.back();
52575053
52585054    const ImVec2 text_size = CalcTextSize(label, NULL, true);
52595055    const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
r244545r244546
52855081            ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL);
52865082            edit_state.ScrollX = 0.0f;
52875083            edit_state.Width = w;
5288            stb_textedit_initialize_state(&edit_state.StbState, true);
5084            stb_textedit_initialize_state(&edit_state.StbState, true);
52895085            edit_state.CursorAnimReset();
52905086            edit_state.LastCursorPos = ImVec2(-1.f,-1.f);
52915087
r244545r244546
53145110        edit_state.BufSize = buf_size < IM_ARRAYSIZE(edit_state.Text) ? buf_size : IM_ARRAYSIZE(edit_state.Text);
53155111        edit_state.Font = window->Font();
53165112        edit_state.FontSize = window->FontSize();
5317
5113   
53185114        const float mx = g.IO.MousePos.x - frame_bb.Min.x - style.FramePadding.x;
53195115        const float my = window->FontSize()*0.5f;   // Flatten mouse because we are doing a single-line edit
53205116
r244545r244546
54905286            }
54915287        }
54925288    }
5493
5289   
54945290    RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
54955291
54965292    const ImVec2 font_off_up = ImVec2(0.0f,window->FontSize()+1.0f);    // FIXME: those offsets are part of the style or font API
r244545r244546
55195315        // Draw blinking cursor
55205316        if (g.InputTextState.CursorIsVisible())
55215317            window->DrawList->AddRect(cursor_pos - font_off_up + ImVec2(0,2), cursor_pos + font_off_dn - ImVec2(0,3), window->Color(ImGuiCol_Text));
5522
5318       
55235319        // Notify OS of text input position
55245320        if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.LastCursorPos - cursor_pos) > 0.0001f)
55255321            io.ImeSetInputScreenPosFn((int)cursor_pos.x - 1, (int)(cursor_pos.y - window->FontSize()));   // -1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.
r244545r244546
55375333
55385334static bool InputFloatN(const char* label, float* v, int components, int decimal_precision)
55395335{
5540    ImGuiState& g = *GImGui;
5336    ImGuiState& g = GImGui;
55415337    ImGuiWindow* window = GetCurrentWindow();
55425338    if (window->SkipItems)
55435339        return false;
55445340
55455341    const ImGuiStyle& style = g.Style;
5546    const float w_full = ImGui::CalcItemWidth();
5342    const float w_full = window->DC.ItemWidth.back();
55475343    const float w_item_one  = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)) / (float)components));
55485344    const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)));
55495345
r244545r244546
55855381    return InputFloatN(label, v, 4, decimal_precision);
55865382}
55875383
5588static bool Items_ArrayGetter(void* data, int idx, const char** out_text)
5384static bool Combo_ArrayGetter(void* data, int idx, const char** out_text)
55895385{
55905386    const char** items = (const char**)data;
55915387    if (out_text)
r244545r244546
55935389    return true;
55945390}
55955391
5596static bool Items_SingleStringGetter(void* data, int idx, const char** out_text)
5392// Combo box helper allowing to pass an array of strings.
5393bool ImGui::Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items)
55975394{
5598    // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited.
5395    const bool value_changed = Combo(label, current_item, Combo_ArrayGetter, (void*)items, items_count, popup_height_items);
5396    return value_changed;
5397}
5398
5399static bool Combo_StringListGetter(void* data, int idx, const char** out_text)
5400{
5401    // FIXME-OPT: we could precompute the indices to fasten this. But only 1 active combo means the waste is limited.
55995402    const char* items_separated_by_zeros = (const char*)data;
56005403    int items_count = 0;
56015404    const char* p = items_separated_by_zeros;
r244545r244546
56135416    return true;
56145417}
56155418
5616// Combo box helper allowing to pass an array of strings.
5617bool ImGui::Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items)
5618{
5619    const bool value_changed = Combo(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_in_items);
5620    return value_changed;
5621}
5622
56235419// Combo box helper allowing to pass all items in a single string.
5624bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items)
5420bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items)
56255421{
56265422    int items_count = 0;
5627    const char* p = items_separated_by_zeros;       // FIXME-OPT: Avoid computing this
5423    const char* p = items_separated_by_zeros;
56285424    while (*p)
56295425    {
56305426        p += strlen(p) + 1;
56315427        items_count++;
56325428    }
5633    bool value_changed = Combo(label, current_item, Items_SingleStringGetter, (void*)items_separated_by_zeros, items_count, height_in_items);
5429    bool value_changed = Combo(label, current_item, Combo_StringListGetter, (void*)items_separated_by_zeros, items_count, popup_height_items);
56345430    return value_changed;
56355431}
56365432
56375433// Combo box function.
5638bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
5434bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_height_items)
56395435{
5640    ImGuiState& g = *GImGui;
5436    ImGuiState& g = GImGui;
56415437    ImGuiWindow* window = GetCurrentWindow();
56425438    if (window->SkipItems)
56435439        return false;
56445440
56455441    const ImGuiStyle& style = g.Style;
56465442    const ImGuiID id = window->GetID(label);
5647    const float w = ImGui::CalcItemWidth();
5443    const float w = window->DC.ItemWidth.back();
56485444
56495445    const ImVec2 text_size = CalcTextSize(label, NULL, true);
56505446    const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
r244545r244546
56575453    const bool hovered = IsHovered(frame_bb, id);
56585454
56595455    bool value_changed = false;
5660    const ImGuiAabb value_bb(frame_bb.Min, frame_bb.Max - ImVec2(arrow_size, 0.0f));
56615456    RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
56625457    RenderFrame(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y), frame_bb.Max, window->Color(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button), true, style.FrameRounding);   // FIXME-ROUNDING
56635458    RenderCollapseTriangle(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y) + style.FramePadding, true);
r244545r244546
56665461    {
56675462        const char* item_text;
56685463        if (items_getter(data, *current_item, &item_text))
5669            RenderTextClipped(frame_bb.Min + style.FramePadding, item_text, NULL, NULL, value_bb.Max);
5464            RenderText(frame_bb.Min + style.FramePadding, item_text, NULL, false);
56705465    }
56715466
56725467    // Empty text doesn't add padding
r244545r244546
56895484                FocusWindow(window);
56905485        }
56915486    }
5692
5487   
56935488    if (g.ActiveComboID == id)
56945489    {
5695        // Size default to hold ~7 items
5696        if (height_in_items < 0)
5697            height_in_items = 7;
5698
56995490        const ImVec2 backup_pos = ImGui::GetCursorPos();
57005491        const float popup_off_x = 0.0f;//style.ItemInnerSpacing.x;
5701        const float popup_height = (text_size.y + style.ItemSpacing.y) * ImMin(items_count, height_in_items) + style.WindowPadding.y;
5492        const float popup_height = (text_size.y + style.ItemSpacing.y) * ImMin(items_count, popup_height_items) + style.WindowPadding.y;
57025493        const ImGuiAabb popup_aabb(ImVec2(frame_bb.Min.x+popup_off_x, frame_bb.Max.y), ImVec2(frame_bb.Max.x+popup_off_x, frame_bb.Max.y + popup_height));
57035494        ImGui::SetCursorPos(popup_aabb.Min - window->Pos);
57045495
57055496        const ImGuiWindowFlags flags = ImGuiWindowFlags_ComboBox | ((window->Flags & ImGuiWindowFlags_ShowBorders) ? ImGuiWindowFlags_ShowBorders : 0);
57065497        ImGui::BeginChild("#ComboBox", popup_aabb.GetSize(), false, flags);
5498        ImGuiWindow* child_window = GetCurrentWindow();
57075499        ImGui::Spacing();
57085500
57095501        bool combo_item_active = false;
5710        combo_item_active |= (g.ActiveId == GetCurrentWindow()->GetID("#SCROLLY"));
5502        combo_item_active |= (g.ActiveId == child_window->GetID("#SCROLLY"));
57115503
57125504        // Display items
5713        for (int i = 0; i < items_count; i++)
5505        for (int item_idx = 0; item_idx < items_count; item_idx++)
57145506        {
5715            ImGui::PushID((void*)(intptr_t)i);
5716            const bool item_selected = (i == *current_item);
5507            const float item_h = child_window->FontSize();
5508            const float spacing_up = (float)(int)(style.ItemSpacing.y/2);
5509            const float spacing_dn = style.ItemSpacing.y - spacing_up;
5510            const ImGuiAabb item_aabb(ImVec2(popup_aabb.Min.x, child_window->DC.CursorPos.y - spacing_up), ImVec2(popup_aabb.Max.x, child_window->DC.CursorPos.y + item_h + spacing_dn));
5511            const ImGuiID item_id = child_window->GetID((void*)(intptr_t)item_idx);
5512
5513            bool item_hovered, item_held;
5514            bool item_pressed = ButtonBehaviour(item_aabb, item_id, &item_hovered, &item_held, true);
5515            bool item_selected = (item_idx == *current_item);
5516
5517            if (item_hovered || item_selected)
5518            {
5519                const ImU32 col = window->Color((item_held && item_hovered) ? ImGuiCol_HeaderActive : item_hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
5520                RenderFrame(item_aabb.Min, item_aabb.Max, col, false);
5521            }
5522
57175523            const char* item_text;
5718            if (!items_getter(data, i, &item_text))
5524            if (!items_getter(data, item_idx, &item_text))
57195525                item_text = "*Unknown item*";
5720            if (ImGui::Selectable(item_text, item_selected))
5526            ImGui::TextUnformatted(item_text);
5527           
5528            if (item_selected)
57215529            {
5530                if (menu_toggled)
5531                    ImGui::SetScrollPosHere();
5532            }
5533            if (item_pressed)
5534            {
57225535                SetActiveId(0);
57235536                g.ActiveComboID = 0;
57245537                value_changed = true;
5725                *current_item = i;
5538                *current_item = item_idx;
57265539            }
5727            if (item_selected && menu_toggled)
5728                ImGui::SetScrollPosHere();
5729            combo_item_active |= ImGui::IsItemActive();
5730            ImGui::PopID();
5540
5541            combo_item_active |= (g.ActiveId == item_id);
57315542        }
57325543        ImGui::EndChild();
57335544        ImGui::SetCursorPos(backup_pos);
5734
5545       
57355546        if (!combo_item_active && g.ActiveId != 0)
57365547            g.ActiveComboID = 0;
57375548    }
r244545r244546
57415552    return value_changed;
57425553}
57435554
5744// Tip: pass an empty label (e.g. "##dummy") then you can use the space to draw other text or image.
5745// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID.
5746bool ImGui::Selectable(const char* label, bool selected, const ImVec2& size_arg)
5747{
5748    ImGuiState& g = *GImGui;
5749    ImGuiWindow* window = GetCurrentWindow();
5750    if (window->SkipItems)
5751        return false;
5752
5753    const ImGuiStyle& style = g.Style;
5754    const ImGuiID id = window->GetID(label);
5755    const ImVec2 text_size = CalcTextSize(label, NULL, true);
5756
5757    const float w = window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x;
5758    const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : w, size_arg.y != 0.0f ? size_arg.y : text_size.y);
5759    const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size);
5760    ItemSize(bb);
5761
5762    // Selectables are meant to be tightly packed together. So for both rendering and collision we extend to compensate for spacing.
5763    ImGuiAabb bb_with_spacing = bb;
5764    const float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f);
5765    const float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f);
5766    const float spacing_R = style.ItemSpacing.x - spacing_L;
5767    const float spacing_D = style.ItemSpacing.y - spacing_U;
5768    bb_with_spacing.Min.x -= spacing_L;
5769    bb_with_spacing.Min.y -= spacing_U;
5770    bb_with_spacing.Max.x += spacing_R;
5771    bb_with_spacing.Max.y += spacing_D;
5772    if (!ItemAdd(bb_with_spacing, &id))
5773        return false;
5774
5775    bool hovered, held;
5776    bool pressed = ButtonBehaviour(bb_with_spacing, id, &hovered, &held, true, false, false);
5777
5778    // Render
5779    if (hovered || selected)
5780    {
5781        const ImU32 col = window->Color((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
5782        RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, style.FrameRounding);
5783    }
5784
5785    //const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);
5786    RenderTextClipped(bb.Min, label, NULL, &text_size, bb_with_spacing.Max);
5787
5788    return pressed;
5789}
5790
5791bool ImGui::Selectable(const char* label, bool* p_selected, const ImVec2& size_arg)
5792{
5793    if (ImGui::Selectable(label, *p_selected, size_arg))
5794    {
5795        *p_selected = !*p_selected;
5796        return true;
5797    }
5798    return false;
5799}
5800
5801// Helper to calculate the size of a listbox and display a label on the right.
5802// Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an empty label "##empty"
5803bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg)
5804{
5805    ImGuiWindow* window = GetCurrentWindow();
5806    if (window->SkipItems)
5807        return false;
5808
5809    const ImGuiStyle& style = ImGui::GetStyle();
5810    const ImGuiID id = ImGui::GetID(label);
5811    const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
5812
5813    // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
5814    ImVec2 size;
5815    size.x = (size_arg.x != 0.0f) ? size_arg.x : ImGui::CalcItemWidth() + style.FramePadding.x * 2.0f;
5816    size.y = (size_arg.y != 0.0f) ? size_arg.y : ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y;
5817    const ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
5818    const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
5819
5820    if (label_size.x > 0)
5821        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
5822
5823    ImGui::BeginChildFrame(id, frame_bb.GetSize());
5824    return true;
5825}
5826
5827bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items)
5828{
5829    // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
5830    // However we don't add +0.40f if items_count <= height_in_items. It is slightly dodgy, because it means a dynamic list of items will make the widget resize occasionally when it crosses that size.
5831    // I am expecting that someone will come and complain about this behavior in a remote future, then we can advise on a better solution.
5832    if (height_in_items < 0)
5833        height_in_items = ImMin(items_count, 7);
5834    float height_in_items_f = height_in_items < items_count ? (height_in_items + 0.40f) : (height_in_items + 0.00f);
5835
5836    // We include ItemSpacing.y so that a list sized for the exact number of items doesn't make a scrollbar appears. We could also enforce that by passing a flag to BeginChild().
5837    ImVec2 size;
5838    size.x = 0.0f;
5839    size.y = ImGui::GetTextLineHeightWithSpacing() * height_in_items_f + ImGui::GetStyle().ItemSpacing.y;
5840    return ImGui::ListBoxHeader(label, size);
5841}
5842
5843void ImGui::ListBoxFooter()
5844{
5845    ImGui::EndChildFrame();
5846}
5847
5848bool ImGui::ListBox(const char* label, int* current_item, const char** items, int items_count, int height_items)
5849{
5850    const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items);
5851    return value_changed;
5852}
5853
5854bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
5855{
5856    if (!ImGui::ListBoxHeader(label, items_count, height_in_items))
5857        return false;
5858
5859    bool value_changed = false;
5860    for (int i = 0; i < items_count; i++)
5861    {
5862        const bool item_selected = (i == *current_item);
5863        const char* item_text;
5864        if (!items_getter(data, i, &item_text))
5865            item_text = "*Unknown item*";
5866
5867        ImGui::PushID(i);
5868        if (ImGui::Selectable(item_text, item_selected))
5869        {
5870            *current_item = i;
5871            value_changed = true;
5872        }
5873        ImGui::PopID();
5874    }
5875
5876    ImGui::ListBoxFooter();
5877    return value_changed;
5878}
5879
58805555// A little colored square. Return true when clicked.
58815556bool ImGui::ColorButton(const ImVec4& col, bool small_height, bool outline_border)
58825557{
5883    ImGuiState& g = *GImGui;
5558    ImGuiState& g = GImGui;
58845559    ImGuiWindow* window = GetCurrentWindow();
58855560    if (window->SkipItems)
58865561        return false;
r244545r244546
59275602// Use CTRL-Click to input value and TAB to go to next item.
59285603bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
59295604{
5930    ImGuiState& g = *GImGui;
5605    ImGuiState& g = GImGui;
59315606    ImGuiWindow* window = GetCurrentWindow();
59325607    if (window->SkipItems)
59335608        return false;
59345609
59355610    const ImGuiStyle& style = g.Style;
59365611    const ImGuiID id = window->GetID(label);
5937    const float w_full = ImGui::CalcItemWidth();
5612    const float w_full = window->DC.ItemWidth.back();
59385613    const float square_sz = (window->FontSize() + style.FramePadding.x * 2.0f);
59395614
59405615    ImGuiColorEditMode edit_mode = window->DC.ColorEditMode;
r244545r244546
60065681            value_changed |= ImGui::InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal);
60075682            ImGui::PopItemWidth();
60085683            char* p = buf;
6009            while (*p == '#' || *p == ' ' || *p == '\t')
5684            while (*p == '#' || *p == ' ' || *p == '\t')
60105685                p++;
60115686
60125687            // Treat at unsigned (%X is unsigned)
r244545r244546
61105785// Advance cursor given item size.
61115786static void ItemSize(ImVec2 size, ImVec2* adjust_vertical_offset)
61125787{
6113    ImGuiState& g = *GImGui;
5788    ImGuiState& g = GImGui;
61145789    ImGuiWindow* window = GetCurrentWindow();
61155790    if (window->SkipItems)
61165791        return;
r244545r244546
61295804    window->DC.CurrentLineHeight = 0.0f;
61305805}
61315806
6132static void ItemSize(const ImGuiAabb& aabb, ImVec2* adjust_start_offset)
6133{
6134    ItemSize(aabb.GetSize(), adjust_start_offset);
5807static void ItemSize(const ImGuiAabb& aabb, ImVec2* adjust_start_offset)
5808{
5809    ItemSize(aabb.GetSize(), adjust_start_offset);
61355810}
61365811
61375812static bool IsClipped(const ImGuiAabb& bb)
61385813{
6139    ImGuiState& g = *GImGui;
5814    ImGuiState& g = GImGui;
61405815    ImGuiWindow* window = GetCurrentWindow();
61415816
61425817    if (!bb.Overlaps(ImGuiAabb(window->ClipRectStack.back())) && !g.LogEnabled)
r244545r244546
61715846//      spacing_w >= 0  : enforce spacing
61725847void ImGui::SameLine(int column_x, int spacing_w)
61735848{
6174    ImGuiState& g = *GImGui;
5849    ImGuiState& g = GImGui;
61755850    ImGuiWindow* window = GetCurrentWindow();
61765851    if (window->SkipItems)
61775852        return;
6178
5853   
61795854    float x, y;
61805855    if (column_x != 0)
61815856    {
r244545r244546
61955870
61965871void ImGui::NextColumn()
61975872{
6198    ImGuiState& g = *GImGui;
5873    ImGuiState& g = GImGui;
61995874    ImGuiWindow* window = GetCurrentWindow();
62005875    if (window->SkipItems)
62015876        return;
r244545r244546
62255900    }
62265901}
62275902
6228// FIMXE-OPT: This is called too often. We need to cache offset for active columns set.
62295903float ImGui::GetColumnOffset(int column_index)
62305904{
6231    ImGuiState& g = *GImGui;
5905    ImGuiState& g = GImGui;
62325906    ImGuiWindow* window = GetCurrentWindow();
62335907    if (column_index < 0)
62345908        column_index = window->DC.ColumnsCurrent;
r244545r244546
62445918
62455919void ImGui::SetColumnOffset(int column_index, float offset)
62465920{
6247    ImGuiState& g = *GImGui;
5921    ImGuiState& g = GImGui;
62485922    ImGuiWindow* window = GetCurrentWindow();
62495923    if (column_index < 0)
62505924        column_index = window->DC.ColumnsCurrent;
r244545r244546
62775951
62785952void ImGui::Columns(int columns_count, const char* id, bool border)
62795953{
6280    ImGuiState& g = *GImGui;
5954    ImGuiState& g = GImGui;
62815955    ImGuiWindow* window = GetCurrentWindow();
62825956    if (window->SkipItems)
62835957        return;
r244545r244546
63015975        for (int i = 1; i < window->DC.ColumnsCount; i++)
63025976        {
63035977            float x = window->Pos.x + GetColumnOffset(i);
6304
5978           
63055979            const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(i);
63065980            const ImGuiAabb column_aabb(ImVec2(x-4,y1),ImVec2(x+4,y2));
63075981
r244545r244546
63456019
63466020void ImGui::TreePush(const char* str_id)
63476021{
6348    ImGuiState& g = *GImGui;
6022    ImGuiState& g = GImGui;
63496023    ImGuiWindow* window = GetCurrentWindow();
63506024    window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
63516025    window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
r244545r244546
63556029
63566030void ImGui::TreePush(const void* ptr_id)
63576031{
6358    ImGuiState& g = *GImGui;
6032    ImGuiState& g = GImGui;
63596033    ImGuiWindow* window = GetCurrentWindow();
63606034    window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
63616035    window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
r244545r244546
63656039
63666040void ImGui::TreePop()
63676041{
6368    ImGuiState& g = *GImGui;
6042    ImGuiState& g = GImGui;
63696043    ImGuiWindow* window = GetCurrentWindow();
63706044    window->DC.ColumnsStartX -= g.Style.TreeNodeSpacing;
63716045    window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
r244545r244546
64776151    }
64786152}
64796153
6480// Scissoring. The values in clip_rect are x1, y1, x2, y2.
64816154void ImDrawList::PushClipRect(const ImVec4& clip_rect)
64826155{
64836156    clip_rect_stack.push_back(clip_rect);
r244545r244546
65336206{
65346207    vtx_write->pos = pos;
65356208    vtx_write->col = col;
6536    vtx_write->uv = GImGui->FontTexUvWhitePixel;
6209    vtx_write->uv = GImGui.FontTexUvWhitePixel;
65376210    vtx_write++;
65386211}
65396212
r244545r244546
65886261        }
65896262        circle_vtx_builds = true;
65906263    }
6591
6264   
65926265    if (tris)
65936266    {
65946267        ReserveVertices((unsigned int)(a_max-a_min) * 3);
r244545r244546
66686341        AddVtx(ImVec2(a.x+r,a.y), col);
66696342        AddVtx(ImVec2(b.x-r,b.y), col);
66706343        AddVtx(ImVec2(a.x+r,b.y), col);
6671
6344       
66726345        float top_y = (rounding_corners & 1) ? a.y+r : a.y;
66736346        float bot_y = (rounding_corners & 8) ? b.y-r : b.y;
66746347        AddVtx(ImVec2(a.x,top_y), col);
r244545r244546
67396412    }
67406413}
67416414
6742void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec2* cpu_clip_max)
6415void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width)
67436416{
67446417    if ((col >> 24) == 0)
67456418        return;
r244545r244546
67556428    const size_t vtx_begin = vtx_buffer.size();
67566429    ReserveVertices(vtx_count_max);
67576430
6758    font->RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, vtx_write, wrap_width, cpu_clip_max);
6431    font->RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, vtx_write, wrap_width);
67596432
67606433    // give back unused vertices
67616434    vtx_buffer.resize((size_t)(vtx_write - &vtx_buffer.front()));
r244545r244546
68436516
68446517void    ImFontAtlas::Clear()
68456518{
6846    ClearInputData();
6519    ClearInputData();
68476520    ClearTexData();
68486521    for (size_t i = 0; i < Fonts.size(); i++)
68496522    {
r244545r244546
69826655        IM_ASSERT(data.OutFont && !data.OutFont->IsLoaded());
69836656        const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)data.TTFData, data.FontNo);
69846657        IM_ASSERT(font_offset >= 0);
6985        if (!stbtt_InitFont(&data.FontInfo, (unsigned char*)data.TTFData, font_offset))
6658        if (!stbtt_InitFont(&data.FontInfo, (unsigned char*)data.TTFData, font_offset))
69866659            return false;
69876660
69886661        if (!data.GlyphRanges)
r244545r244546
70056678
70066679    // Pack our extra data rectangle first, so it will be on the upper-left corner of our texture (UV will have small values).
70076680    stbrp_rect extra_rect;
7008    extra_rect.w = (stbrp_coord)TEX_ATLAS_SIZE.x;
7009    extra_rect.h = (stbrp_coord)TEX_ATLAS_SIZE.y;
6681    extra_rect.w = (int)TEX_ATLAS_SIZE.x;
6682    extra_rect.h = (int)TEX_ATLAS_SIZE.y;
70106683    stbrp_pack_rects((stbrp_context*)spc.pack_info, &extra_rect, 1);
70116684    TexExtraDataPos = ImVec2(extra_rect.x, extra_rect.y);
70126685
r244545r244546
72276900{
72286901    // Store the 1946 ideograms code points as successive offsets from the initial unicode codepoint 0x4E00. Each offset has an implicit +1.
72296902    // This encoding helps us reduce the source code size.
7230    static const short offsets_from_0x4E00[] =
6903    static const short offsets_from_0x4E00[] =
72316904    {
72326905        -1,0,1,3,0,0,0,0,1,0,5,1,1,0,7,4,6,10,0,1,9,9,7,1,3,19,1,10,7,1,0,1,0,5,1,0,6,4,2,6,0,0,12,6,8,0,3,5,0,1,0,9,0,0,8,1,1,3,4,5,13,0,0,8,2,17,
72336906        4,3,1,1,9,6,0,0,0,2,1,3,2,22,1,9,11,1,13,1,3,12,0,5,9,2,0,6,12,5,3,12,4,1,2,16,1,1,4,6,5,3,0,6,13,15,5,12,8,14,0,0,6,15,3,6,0,18,8,1,6,14,1,
r244545r244546
72686941        0x0020, 0x00FF, // Basic Latin + Latin Supplement
72696942        0x3040, 0x309F, // Hiragana, Katakana
72706943        0xFF00, 0xFFEF, // Half-width characters
7271        0,
6944        0,
72726945    };
72736946    if (!ranges_unpacked)
72746947    {
r244545r244546
73347007            *out_char = c;
73357008            return 1;
73367009        }
7337        if ((*str & 0xe0) == 0xc0)
7010        if ((*str & 0xe0) == 0xc0)
73387011        {
73397012            if (in_text_end && in_text_end - (const char*)str < 2) return -1;
73407013            if (*str < 0xc2) return -1;
r244545r244546
73447017            *out_char = c;
73457018            return 2;
73467019        }
7347        if ((*str & 0xf0) == 0xe0)
7020        if ((*str & 0xf0) == 0xe0)
73487021        {
73497022            if (in_text_end && in_text_end - (const char*)str < 3) return -1;
73507023            if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return -1;
r244545r244546
73577030            *out_char = c;
73587031            return 3;
73597032        }
7360        if ((*str & 0xf8) == 0xf0)
7033        if ((*str & 0xf8) == 0xf0)
73617034        {
73627035            if (in_text_end && in_text_end - (const char*)str < 4) return -1;
73637036            if (*str > 0xf4) return -1;
r244545r244546
74157088    {
74167089        size_t i = 0;
74177090        size_t n = buf_size;
7418        if (c < 0x80)
7091        if (c < 0x80)
74197092        {
74207093            if (i+1 > n) return 0;
74217094            buf[i++] = (char)c;
74227095            return 1;
7423        }
7424        else if (c < 0x800)
7096        }
7097        else if (c < 0x800)
74257098        {
74267099            if (i+2 > n) return 0;
74277100            buf[i++] = (char)(0xc0 + (c >> 6));
r244545r244546
74317104        else if (c >= 0xdc00 && c < 0xe000)
74327105        {
74337106            return 0;
7434        }
7435        else if (c >= 0xd800 && c < 0xdc00)
7107        }
7108        else if (c >= 0xd800 && c < 0xdc00)
74367109        {
74377110            if (i+4 > n) return 0;
74387111            buf[i++] = (char)(0xf0 + (c >> 18));
r244545r244546
76147287        unsigned int c;
76157288        const int bytes_count = ImTextCharFromUtf8(&c, s, text_end);
76167289        s += bytes_count > 0 ? bytes_count : 1;
7617
7290       
76187291        if (c == '\n')
76197292        {
76207293            text_size.x = ImMax(text_size.x, line_width);
r244545r244546
76227295            line_width = 0.0f;
76237296            continue;
76247297        }
7625
7298       
76267299        float char_width = 0.0f;
76277300        if (const Glyph* glyph = FindGlyph((unsigned short)c))
76287301            char_width = glyph->XAdvance * scale;
r244545r244546
76697342            line_width = 0.0f;
76707343            continue;
76717344        }
7672
7345       
76737346        float char_width = 0.0f;
76747347        if (const Glyph* glyph = FindGlyph((unsigned short)c))
76757348            char_width = glyph->XAdvance * scale;
r244545r244546
76937366    return text_size;
76947367}
76957368
7696void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect_ref, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width, const ImVec2* cpu_clip_max) const
7369void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect_ref, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width) const
76977370{
76987371    if (!text_end)
76997372        text_end = text_begin + strlen(text_begin);
r244545r244546
77087381    const bool word_wrap_enabled = (wrap_width > 0.0f);
77097382    const char* word_wrap_eol = NULL;
77107383
7711    ImVec4 clip_rect = clip_rect_ref;
7712    if (cpu_clip_max)
7713    {
7714        clip_rect.z = ImMin(clip_rect.z, cpu_clip_max->x);
7715        clip_rect.w = ImMin(clip_rect.w, cpu_clip_max->y);
7716    }
7384    const ImVec4 clip_rect = clip_rect_ref;
77177385    float x = pos.x;
77187386    float y = pos.y;
77197387
r244545r244546
77657433            if (c != ' ' && c != '\t')
77667434            {
77677435                // Clipping on Y is more likely
7768                float y1 = (float)(y + glyph->YOffset * scale);
7769                float y2 = (float)(y1 + glyph->Height * scale);
7436                const float y1 = (float)(y + glyph->YOffset * scale);
7437                const float y2 = (float)(y1 + glyph->Height * scale);
77707438                if (y1 <= clip_rect.w && y2 >= clip_rect.y)
77717439                {
7772                    float x1 = (float)(x + glyph->XOffset * scale);
7773                    float x2 = (float)(x1 + glyph->Width * scale);
7440                    const float x1 = (float)(x + glyph->XOffset * scale);
7441                    const float x2 = (float)(x1 + glyph->Width * scale);
77747442                    if (x1 <= clip_rect.z && x2 >= clip_rect.x)
77757443                    {
77767444                        // Render a character
7777                        float u1 = glyph->U0;
7778                        float v1 = glyph->V0;
7779                        float u2 = glyph->U1;
7780                        float v2 = glyph->V1;
7445                        const float u0 = glyph->U0;
7446                        const float v0 = glyph->V0;
7447                        const float u1 = glyph->U1;
7448                        const float v1 = glyph->V1;
77817449
7782                        // CPU side clipping used to fit text in their frame when the frame is too small. Only does clipping for axis aligned quad and in the "max" direction (bottom-right)
7783                        if (cpu_clip_max)
7784                        {
7785                            if (x2 > cpu_clip_max->x)
7786                            {
7787                                const float clip_tx = (cpu_clip_max->x - x1) / (x2 - x1);
7788                                x2 = cpu_clip_max->x;
7789                                u2 = u1 + clip_tx * (u2 - u1);
7790                            }
7791                            if (y2 > cpu_clip_max->y)
7792                            {
7793                                const float clip_ty = (cpu_clip_max->y - y1) / (y2 - y1);
7794                                y2 = cpu_clip_max->y;
7795                                v2 = v1 + clip_ty * (v2 - v1);
7796                            }
7797                        }
7798
77997450                        out_vertices[0].pos = ImVec2(x1, y1);
7800                        out_vertices[0].uv  = ImVec2(u1, v1);
7451                        out_vertices[0].uv  = ImVec2(u0, v0);
78017452                        out_vertices[0].col = col;
78027453
78037454                        out_vertices[1].pos = ImVec2(x2, y1);
7804                        out_vertices[1].uv  = ImVec2(u2, v1);
7455                        out_vertices[1].uv  = ImVec2(u1, v0);
78057456                        out_vertices[1].col = col;
78067457
78077458                        out_vertices[2].pos = ImVec2(x2, y2);
7808                        out_vertices[2].uv  = ImVec2(u2, v2);
7459                        out_vertices[2].uv  = ImVec2(u1, v1);
78097460                        out_vertices[2].col = col;
78107461
78117462                        out_vertices[3] = out_vertices[0];
78127463                        out_vertices[4] = out_vertices[2];
78137464
78147465                        out_vertices[5].pos = ImVec2(x1, y2);
7815                        out_vertices[5].uv  = ImVec2(u1, v2);
7466                        out_vertices[5].uv  = ImVec2(u0, v1);
78167467                        out_vertices[5].col = col;
78177468
78187469                        out_vertices += 6;
r244545r244546
78437494        ImGui::MemFree(buf_local);
78447495        buf_local = NULL;
78457496    }
7846    if (!OpenClipboard(NULL))
7497    if (!OpenClipboard(NULL))
78477498        return NULL;
7848    HANDLE buf_handle = GetClipboardData(CF_TEXT);
7499    HANDLE buf_handle = GetClipboardData(CF_TEXT);
78497500    if (buf_handle == NULL)
78507501        return NULL;
78517502    if (char* buf_global = (char*)GlobalLock(buf_handle))
78527503        buf_local = ImStrdup(buf_global);
7853    GlobalUnlock(buf_handle);
7854    CloseClipboard();
7504    GlobalUnlock(buf_handle);
7505    CloseClipboard();
78557506    return buf_local;
78567507}
78577508
r244545r244546
78627513        return;
78637514    const char* text_end = text + strlen(text);
78647515    const int buf_length = (int)(text_end - text) + 1;
7865    HGLOBAL buf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)buf_length * sizeof(char));
7516    HGLOBAL buf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)buf_length * sizeof(char));
78667517    if (buf_handle == NULL)
78677518        return;
7868    char* buf_global = (char *)GlobalLock(buf_handle);
7519    char* buf_global = (char *)GlobalLock(buf_handle);
78697520    memcpy(buf_global, text, (size_t)(text_end - text));
78707521    buf_global[text_end - text] = 0;
7871    GlobalUnlock(buf_handle);
7522    GlobalUnlock(buf_handle);
78727523    EmptyClipboard();
78737524    SetClipboardData(CF_TEXT, buf_handle);
78747525    CloseClipboard();
r244545r244546
78797530// Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
78807531static const char*  GetClipboardTextFn_DefaultImpl()
78817532{
7882    return GImGui->PrivateClipboard;
7533    return GImGui.PrivateClipboard;
78837534}
78847535
78857536// Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
78867537static void SetClipboardTextFn_DefaultImpl(const char* text)
78877538{
7888    ImGuiState& g = *GImGui;
7889    if (g.PrivateClipboard)
7539    if (GImGui.PrivateClipboard)
78907540    {
7891        ImGui::MemFree(g.PrivateClipboard);
7892        g.PrivateClipboard = NULL;
7541        ImGui::MemFree(GImGui.PrivateClipboard);
7542        GImGui.PrivateClipboard = NULL;
78937543    }
78947544    const char* text_end = text + strlen(text);
7895    g.PrivateClipboard = (char*)ImGui::MemAlloc((size_t)(text_end - text) + 1);
7896    memcpy(g.PrivateClipboard, text, (size_t)(text_end - text));
7897    g.PrivateClipboard[(size_t)(text_end - text)] = 0;
7545    GImGui.PrivateClipboard = (char*)ImGui::MemAlloc((size_t)(text_end - text) + 1);
7546    memcpy(GImGui.PrivateClipboard, text, (size_t)(text_end - text));
7547    GImGui.PrivateClipboard[(size_t)(text_end - text)] = 0;
78987548}
78997549
79007550#endif
r244545r244546
79057555
79067556void ImGui::ShowUserGuide()
79077557{
7908    ImGuiState& g = *GImGui;
7558    ImGuiState& g = GImGui;
79097559
79107560    ImGui::BulletText("Double-click on title bar to collapse window.");
79117561    ImGui::BulletText("Click and drag on lower right corner to resize window.");
r244545r244546
79297579
79307580void ImGui::ShowStyleEditor(ImGuiStyle* ref)
79317581{
7932    ImGuiState& g = *GImGui;
7582    ImGuiState& g = GImGui;
79337583    ImGuiStyle& style = g.Style;
79347584
79357585    const ImGuiStyle def; // Default style
r244545r244546
79507600        ImGui::SliderFloat("Alpha", &style.Alpha, 0.20f, 1.0f, "%.2f");                 // Not exposing zero here so user doesn't "lose" the UI. But application code could have a toggle to switch between zero and non-zero.
79517601        ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
79527602        ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 16.0f, "%.0f");
7953        ImGui::SliderFloat("ChildWindowRounding", &style.ChildWindowRounding, 0.0f, 16.0f, "%.0f");
79547603        ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
79557604        ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 16.0f, "%.0f");
79567605        ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
r244545r244546
80387687    static bool no_resize = false;
80397688    static bool no_move = false;
80407689    static bool no_scrollbar = false;
8041    static bool no_collapse = false;
80427690    static float fill_alpha = 0.65f;
80437691
8044    // Demonstrate the various window flags. Typically you would just use the default.
8045    ImGuiWindowFlags window_flags = 0;
8046    if (no_titlebar)  window_flags |= ImGuiWindowFlags_NoTitleBar;
8047    if (!no_border)   window_flags |= ImGuiWindowFlags_ShowBorders;
8048    if (no_resize)    window_flags |= ImGuiWindowFlags_NoResize;
8049    if (no_move)      window_flags |= ImGuiWindowFlags_NoMove;
8050    if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
8051    if (no_collapse)  window_flags |= ImGuiWindowFlags_NoCollapse;
8052    if (!ImGui::Begin("ImGui Test", opened, ImVec2(550,680), fill_alpha, window_flags))
7692    const ImGuiWindowFlags layout_flags = (no_titlebar ? ImGuiWindowFlags_NoTitleBar : 0) | (no_border ? 0 : ImGuiWindowFlags_ShowBorders) | (no_resize ? ImGuiWindowFlags_NoResize : 0) | (no_move ? ImGuiWindowFlags_NoMove : 0) | (no_scrollbar ? ImGuiWindowFlags_NoScrollbar : 0);
7693    if (!ImGui::Begin("ImGui Test", opened, ImVec2(550,680), fill_alpha, layout_flags))
80537694    {
80547695        // Early out if the window is collapsed, as an optimization.
80557696        ImGui::End();
r244545r244546
80607701    ImGui::Text("ImGui says hello.");
80617702    //ImGui::Text("MousePos (%g, %g)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
80627703    //ImGui::Text("MouseWheel %d", ImGui::GetIO().MouseWheel);
8063    //ImGui::Text("WantCaptureMouse: %d", ImGui::GetIO().WantCaptureMouse);
8064    //ImGui::Text("WantCaptureKeyboard: %d", ImGui::GetIO().WantCaptureKeyboard);
80657704
80667705    ImGui::Spacing();
80677706    if (ImGui::CollapsingHeader("Help"))
r244545r244546
80747713    {
80757714        ImGui::Checkbox("no titlebar", &no_titlebar); ImGui::SameLine(150);
80767715        ImGui::Checkbox("no border", &no_border); ImGui::SameLine(300);
8077        ImGui::Checkbox("no resize", &no_resize);
7716        ImGui::Checkbox("no resize", &no_resize);
80787717        ImGui::Checkbox("no move", &no_move); ImGui::SameLine(150);
8079        ImGui::Checkbox("no scrollbar", &no_scrollbar); ImGui::SameLine(300);
8080        ImGui::Checkbox("no collapse", &no_collapse);
7718        ImGui::Checkbox("no scrollbar", &no_scrollbar);
80817719        ImGui::SliderFloat("fill alpha", &fill_alpha, 0.0f, 1.0f);
80827720
80837721        if (ImGui::TreeNode("Style"))
r244545r244546
81257763        if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; }
81267764        if (a)
81277765        {
8128            ImGui::SameLine();
7766            ImGui::SameLine();
81297767            ImGui::Text("Thanks for clicking me!");
81307768        }
81317769
r244545r244546
82037841            ImGui::TreePop();
82047842        }
82057843
8206        if (ImGui::TreeNode("Clipping"))
8207        {
8208            static ImVec2 size(80, 20);
8209            ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text if it won't fit in its frame.");
8210            ImGui::SliderFloat2("size", (float*)&size, 5.0f, 200.0f);
8211            ImGui::Button("Line 1 hello\nLine 2 clip me!", size);
8212            ImGui::TextWrapped("Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and rendering cost.");
8213            ImGui::TreePop();
8214        }
8215
82167844        if (ImGui::TreeNode("Images"))
82177845        {
82187846            ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
r244545r244546
82507878            ImGui::TreePop();
82517879        }
82527880
8253        if (ImGui::TreeNode("Selectables"))
8254        {
8255            if (ImGui::TreeNode("Basic"))
8256            {
8257                static bool selected[3] = { false, true, false };
8258                ImGui::Selectable("1. I am selectable", &selected[0]);
8259                ImGui::Selectable("2. I am selectable", &selected[1]);
8260                ImGui::Text("3. I am normal text");
8261                ImGui::Selectable("4. I am selectable", &selected[2]);
8262                ImGui::TreePop();
8263            }
8264            if (ImGui::TreeNode("Rendering more text into the same block"))
8265            {
8266                static bool selected[3] = { false, false, false };
8267                ImGui::Selectable("main.c", &selected[0]);    ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
8268                ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
8269                ImGui::Selectable("Hello.h", &selected[2]);   ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
8270                ImGui::TreePop();
8271            }
8272            if (ImGui::TreeNode("Grid"))
8273            {
8274                static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
8275                for (int i = 0; i < 16; i++)
8276                {
8277                    ImGui::PushID(i);
8278                    if (ImGui::Selectable("Me", &selected[i], ImVec2(50,50)))
8279                    {
8280                        int x = i % 4, y = i / 4;
8281                        if (x > 0) selected[i - 1] ^= 1;
8282                        if (x < 3) selected[i + 1] ^= 1;
8283                        if (y > 0) selected[i - 4] ^= 1;
8284                        if (y < 3) selected[i + 4] ^= 1;
8285                    }
8286                    if ((i % 4) < 3) ImGui::SameLine();
8287                    ImGui::PopID();
8288                }
8289                ImGui::TreePop();
8290            }
8291            ImGui::TreePop();
8292        }
8293
82947881        static bool check = true;
82957882        ImGui::Checkbox("checkbox", &check);
82967883
r244545r244546
83877974        static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
83887975        ImGui::ColorEdit3("color 1", col1);
83897976        ImGui::ColorEdit4("color 2", col2);
8390
8391        const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
8392        static int listbox_item_current = 1;
8393        ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
8394
8395        //ImGui::PushItemWidth(-1);
8396        //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
8397        //ImGui::PopItemWidth();
83987977    }
83997978
84007979    if (ImGui::CollapsingHeader("Graphs widgets"))
r244545r244546
84037982        ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
84047983
84057984        static bool pause;
8406        static ImVector<float> values; if (values.empty()) { values.resize(100); memset(&values.front(), 0, values.size()*sizeof(float)); }
8407        static size_t values_offset = 0;
8408        if (!pause)
8409        {
7985        static ImVector<float> values; if (values.empty()) { values.resize(100); memset(&values.front(), 0, values.size()*sizeof(float)); }
7986        static size_t values_offset = 0;
7987        if (!pause)
7988        {
84107989            // create dummy data at fixed 60 hz rate
84117990            static float refresh_time = -1.0f;
84127991            if (ImGui::GetTime() > refresh_time + 1.0f/60.0f)
84137992            {
84147993                refresh_time = ImGui::GetTime();
84157994                static float phase = 0.0f;
8416                values[values_offset] = cosf(phase);
8417                values_offset = (values_offset+1)%values.size();
8418                phase += 0.10f*values_offset;
7995                values[values_offset] = cosf(phase);
7996                values_offset = (values_offset+1)%values.size();
7997                phase += 0.10f*values_offset;
84197998            }
84207999        }
84218000        ImGui::PlotLines("Frame Times", &values.front(), (int)values.size(), (int)values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,70));
r244545r244546
84708049        ImGui::Text("Without border");
84718050        static int line = 50;
84728051        bool goto_line = ImGui::Button("Goto");
8473        ImGui::SameLine();
8052        ImGui::SameLine();
84748053        ImGui::PushItemWidth(100);
84758054        goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
84768055        ImGui::PopItemWidth();
r244545r244546
84878066
84888067        ImGui::SameLine();
84898068
8490        ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, 5.0f);
84918069        ImGui::BeginChild("Sub2", ImVec2(0,300), true);
84928070        ImGui::Text("With border");
84938071        ImGui::Columns(2);
r244545r244546
85008078            ImGui::Button(buf);
85018079        }
85028080        ImGui::EndChild();
8503        ImGui::PopStyleVar();
85048081    }
85058082
85068083    if (ImGui::CollapsingHeader("Columns"))
r244545r244546
85348111
85358112        // Create multiple items in a same cell because switching to next column
85368113        static int e = 0;
8537        ImGui::Text("Hello");
8114        ImGui::Text("Hello");
85388115        ImGui::Button("Banana");
8539        ImGui::RadioButton("radio a", &e, 0);
8116        ImGui::RadioButton("radio a", &e, 0);
85408117        ImGui::NextColumn();
85418118
8542        ImGui::Text("ImGui");
8119        ImGui::Text("ImGui");
85438120        ImGui::Button("Apple");
85448121        ImGui::RadioButton("radio b", &e, 1);
85458122        ImGui::Text("An extra line here.");
85468123        ImGui::NextColumn();
8547
8124       
85488125        ImGui::Text("World!");
85498126        ImGui::Button("Corniflower");
85508127        ImGui::RadioButton("radio c", &e, 2);
r244545r244546
85668143        ImGui::Columns(1);
85678144
85688145        ImGui::Separator();
8569
8570        ImGui::Columns(2, "tree items");
8571        if (ImGui::TreeNode("Hello")) { ImGui::BulletText("World"); ImGui::TreePop(); } ImGui::NextColumn();
8572        if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Monde"); ImGui::TreePop(); }
8573        ImGui::Columns(1);
8574        ImGui::Separator();
8575
8146       
85768147        ImGui::Columns(2, "word wrapping");
85778148        ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
85788149        ImGui::Text("Hello Left");
r244545r244546
86568227            bool focus_3 = ImGui::Button("Focus on 3");
86578228            int has_focus = 0;
86588229            static char buf[128] = "click on a button to set focus";
8659
8230           
86608231            if (focus_1) ImGui::SetKeyboardFocusHere();
86618232            ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
86628233            if (ImGui::IsItemActive()) has_focus = 1;
8663
8234           
86648235            if (focus_2) ImGui::SetKeyboardFocusHere();
86658236            ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
86668237            if (ImGui::IsItemActive()) has_focus = 2;
r244545r244546
86728243            ImGui::PopAllowKeyboardFocus();
86738244            if (has_focus)
86748245                ImGui::Text("Item with focus: %d", has_focus);
8675            else
8246            else
86768247                ImGui::Text("Item with focus: <none>");
86778248            ImGui::TreePop();
86788249        }
r244545r244546
87338304    ImGui::SetWindowPos(ImVec2(10,10));
87348305    ImGui::Text("Simple overlay\non the top-left side of the screen.");
87358306    ImGui::Separator();
8736    ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
8307    ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
87378308
87388309    ImGui::End();
87398310}
r244545r244546
87628333
87638334    // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered()
87648335    // However you can draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos().
8765    // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max).
8336    // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max) followed by an empty Text("") statement.
87668337    ImVec2 canvas_pos = ImGui::GetCursorScreenPos();            // ImDrawList API uses screen coordinates!
87678338    ImVec2 canvas_size = ImVec2(ImMax(50.0f,ImGui::GetWindowContentRegionMax().x-ImGui::GetCursorPos().x), ImMax(50.0f,ImGui::GetWindowContentRegionMax().y-ImGui::GetCursorPos().y));    // Resize canvas what's available
87688339    draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), 0xFFFFFFFF);
r244545r244546
88208391    ~ExampleAppConsole()
88218392    {
88228393        ClearLog();
8823        for (size_t i = 0; i < Items.size(); i++)
8824            ImGui::MemFree(History[i]);
8394        for (size_t i = 0; i < Items.size(); i++)
8395            ImGui::MemFree(History[i]);
88258396    }
88268397
88278398    void    ClearLog()
88288399    {
8829        for (size_t i = 0; i < Items.size(); i++)
8830            ImGui::MemFree(Items[i]);
8400        for (size_t i = 0; i < Items.size(); i++)
8401            ImGui::MemFree(Items[i]);
88318402        Items.clear();
88328403        ScrollToBottom = true;
88338404    }
r244545r244546
88578428        // TODO: display from bottom
88588429        // TODO: clip manually
88598430
8860        if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.size()); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine();
8861        if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
8431        if (ImGui::SmallButton("Add Dummy Text")) AddLog("some text\nsome more text\ndisplay very important message here!\n"); ImGui::SameLine();
8432        if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
88628433        if (ImGui::SmallButton("Clear")) ClearLog();
88638434        ImGui::Separator();
88648435
r244545r244546
88708441        ImGui::Separator();
88718442
88728443        // Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end());
8873        // NB- if you have thousands of entries this approach may be too inefficient. You can seek and display only the lines that are visible - CalcListClipping() is a helper to compute this information.
8874        // If your items are of variable size you may want to implement code similar to what CalcListClipping() does. Or split your data into fixed height items to allow random-seeking into your list.
8875        ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetTextLineHeightWithSpacing()*2));
8444        // NB- if you have lots of text this approach may be too inefficient. You can seek and display only the lines that are on display using a technique similar to what TextUnformatted() does,
8445        // or faster if your entries are already stored into a table.
8446        ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetTextLineSpacing()*2));
88768447        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing
88778448        for (size_t i = 0; i < Items.size(); i++)
88788449        {
r244545r244546
90668637        return;
90678638    }
90688639
9069    static int test_type = 0;
90708640    static ImGuiTextBuffer log;
90718641    static int lines = 0;
90728642    ImGui::Text("Printing unusually long amount of text.");
9073    ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped");
90748643    ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
90758644    if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
90768645    ImGui::SameLine();
r244545r244546
90818650        lines += 1000;
90828651    }
90838652    ImGui::BeginChild("Log");
9084    switch (test_type)
9085    {
9086    case 0:
9087        // Single call to TextUnformatted() with a big buffer
9088        ImGui::TextUnformatted(log.begin(), log.end());
9089        break;
9090    case 1:
9091        // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the CalcListClipping() helper.
9092        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
9093        int display_start, display_end;
9094        ImGui::CalcListClipping(lines, ImGui::GetTextLineHeight(), &display_start, &display_end);
9095        ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * ImGui::GetTextLineHeight());
9096        for (int i = display_start; i < display_end; i++)
9097            ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
9098        ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (lines - display_end) * ImGui::GetTextLineHeight());
9099        ImGui::PopStyleVar();
9100        break;
9101    case 2:
9102        // Multiple calls to Text(), not clipped
9103        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
9104        for (int i = 0; i < lines; i++)
9105            ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
9106        ImGui::PopStyleVar();
9107        break;
9108    }
8653    ImGui::TextUnformatted(log.begin(), log.end());
91098654    ImGui::EndChild();
8655
91108656    ImGui::End();
91118657}
91128658
r244545r244546
92028748        buflen -= blocklen;
92038749        blocklen = 5552;
92048750    }
9205    return (unsigned int)(s2 << 16) + (unsigned int)s1;
8751    return (s2 << 16) + s1;
92068752}
92078753
92088754static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length)
r244545r244546
92188764    i += 16;
92198765
92208766    stb__dout = output;
9221    for (;;) {
8767    while (1) {
92228768        unsigned char *old_i = i;
92238769        i = stb_decompress_token(i);
92248770        if (i == old_i) {
r244545r244546
92338779                return 0;
92348780            }
92358781        }
9236        assert(stb__dout <= output + olen);
8782        assert(stb__dout <= output + olen);
92378783        if (stb__dout > output + olen)
92388784            return 0;
92398785    }
r244545r244546
92428788static const unsigned int proggy_clean_ttf_compressed_size = 9583;
92438789static const unsigned int proggy_clean_ttf_compressed_data[9584/4] =
92448790{
9245    0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
9246    0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
9247    0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
9248    0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
9249    0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
9250    0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
9251    0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
9252    0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
9253    0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
9254    0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
9255    0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
9256    0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
9257    0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
9258    0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
9259    0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
9260    0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
9261    0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
9262    0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
9263    0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
9264    0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
9265    0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
9266    0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
9267    0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
9268    0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
9269    0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
9270    0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
9271    0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
9272    0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
9273    0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
9274    0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
9275    0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
9276    0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
9277    0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
9278    0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
9279    0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
9280    0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
9281    0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
9282    0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
9283    0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
9284    0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
9285    0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
9286    0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
9287    0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
9288    0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
9289    0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
9290    0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
9291    0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
9292    0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
9293    0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
9294    0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
9295    0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
9296    0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
9297    0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
9298    0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
9299    0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
9300    0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
9301    0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
9302    0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
9303    0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
9304    0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
9305    0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
9306    0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
9307    0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
9308    0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
9309    0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
9310    0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
9311    0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
9312    0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
9313    0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
9314    0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
9315    0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
9316    0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
9317    0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
9318    0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
9319    0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
9320    0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
9321    0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
9322    0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
9323    0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
9324    0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
9325    0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
9326    0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
9327    0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
9328    0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
9329    0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
9330    0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
9331    0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
9332    0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
9333    0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
9334    0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
9335    0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
9336    0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
9337    0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
9338    0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
9339    0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
9340    0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
9341    0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
9342    0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
9343    0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
9344    0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
9345    0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
9346    0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
9347    0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
9348    0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
9349    0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
9350    0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
9351    0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
9352    0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
9353    0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
9354    0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
9355    0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
9356    0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
9357    0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
9358    0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
9359    0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
9360    0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
9361    0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
9362    0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
9363    0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
9364    0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
9365    0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
9366    0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
9367    0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
9368    0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
9369    0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
9370    0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
9371    0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
9372    0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
9373    0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
9374    0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
9375    0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
9376    0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
9377    0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
9378    0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
9379    0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
9380    0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
9381    0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
9382    0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
9383    0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
9384    0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
9385    0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
9386    0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
9387    0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
9388    0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
9389    0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
9390    0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
9391    0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
9392    0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
9393    0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
9394    0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
9395    0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
9396    0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
9397    0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
9398    0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
9399    0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
9400    0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
9401    0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
9402    0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
9403    0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
9404    0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
9405    0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
9406    0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
9407    0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
9408    0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
9409    0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
9410    0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
9411    0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
9412    0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
9413    0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
9414    0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
9415    0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
9416    0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
9417    0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
9418    0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
9419    0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
9420    0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
9421    0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
9422    0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
9423    0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
9424    0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
9425    0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
9426    0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
9427    0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
9428    0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
9429    0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
9430    0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
9431    0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
9432    0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
9433    0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
9434    0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
9435    0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
9436    0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
9437    0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
9438    0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
9439    0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
9440    0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
9441    0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
9442    0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
9443    0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
9444    0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
8791    0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
8792    0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
8793    0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
8794    0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
8795    0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
8796    0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
8797    0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
8798    0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
8799    0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
8800    0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
8801    0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
8802    0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
8803    0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
8804    0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
8805    0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
8806    0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
8807    0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
8808    0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
8809    0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
8810    0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
8811    0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
8812    0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
8813    0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
8814    0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
8815    0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
8816    0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
8817    0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
8818    0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
8819    0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
8820    0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
8821    0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
8822    0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
8823    0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
8824    0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
8825    0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
8826    0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
8827    0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
8828    0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
8829    0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
8830    0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
8831    0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
8832    0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
8833    0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
8834    0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
8835    0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
8836    0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
8837    0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
8838    0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
8839    0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
8840    0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
8841    0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
8842    0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
8843    0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
8844    0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
8845    0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
8846    0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
8847    0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
8848    0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
8849    0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
8850    0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
8851    0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
8852    0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
8853    0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
8854    0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
8855    0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
8856    0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
8857    0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
8858    0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
8859    0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
8860    0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
8861    0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
8862    0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
8863    0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
8864    0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
8865    0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
8866    0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
8867    0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
8868    0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
8869    0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
8870    0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
8871    0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
8872    0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
8873    0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
8874    0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
8875    0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
8876    0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
8877    0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
8878    0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
8879    0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
8880    0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
8881    0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
8882    0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
8883    0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
8884    0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
8885    0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
8886    0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
8887    0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
8888    0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
8889    0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
8890    0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
8891    0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
8892    0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
8893    0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
8894    0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
8895    0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
8896    0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
8897    0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
8898    0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
8899    0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
8900    0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
8901    0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
8902    0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
8903    0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
8904    0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
8905    0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
8906    0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
8907    0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
8908    0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
8909    0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
8910    0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
8911    0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
8912    0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
8913    0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
8914    0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
8915    0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
8916    0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
8917    0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
8918    0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
8919    0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
8920    0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
8921    0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
8922    0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
8923    0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
8924    0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
8925    0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
8926    0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
8927    0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
8928    0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
8929    0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
8930    0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
8931    0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
8932    0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
8933    0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
8934    0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
8935    0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
8936    0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
8937    0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
8938    0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
8939    0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
8940    0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
8941    0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
8942    0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
8943    0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
8944    0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
8945    0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
8946    0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
8947    0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
8948    0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
8949    0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
8950    0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
8951    0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
8952    0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
8953    0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
8954    0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
8955    0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
8956    0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
8957    0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
8958    0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
8959    0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
8960    0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
8961    0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
8962    0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
8963    0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
8964    0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
8965    0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
8966    0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
8967    0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
8968    0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
8969    0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
8970    0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
8971    0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
8972    0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
8973    0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
8974    0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
8975    0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
8976    0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
8977    0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
8978    0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
8979    0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
8980    0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
8981    0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
8982    0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
8983    0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
8984    0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
8985    0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
8986    0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
8987    0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
8988    0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
8989    0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
8990    0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
94458991};
94468992
94478993static void GetDefaultCompressedFontDataTTF(const void** ttf_compressed_data, unsigned int* ttf_compressed_size)
branches/kale/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
r244545r244546
1// ImGui library v1.32 wip
2// See .cpp file for documentation.
1// ImGui library v1.30
2// See .cpp file for commentary.
33// See ImGui::ShowTestWindow() for sample code.
44// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
55// Get latest version at https://github.com/ocornut/imgui
r244545r244546
4343typedef int ImGuiWindowFlags;       // enum ImGuiWindowFlags_
4444typedef int ImGuiSetCondition;      // enum ImGuiSetCondition_
4545typedef int ImGuiInputTextFlags;    // enum ImGuiInputTextFlags_
46struct ImGuiTextEditCallbackData;   // for advanced uses of InputText()
46struct ImGuiTextEditCallbackData;   // for advanced uses of InputText()
4747
4848struct ImVec2
4949{
r244545r244546
6969
7070namespace ImGui
7171{
72    // Proxy functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
72    // Proxy functions to access the MemAllocFn/MemFreeFn/MemReallocFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
7373    IMGUI_API void*       MemAlloc(size_t sz);
7474    IMGUI_API void        MemFree(void* ptr);
75    IMGUI_API void*       MemRealloc(void* ptr, size_t sz);
7576}
7677
77// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
78// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
7879// Use '#define ImVector std::vector' if you want to use the STL type or your own type.
7980// Our implementation does NOT call c++ constructors! because the data types we use don't need them (but that could be added as well). Only provide the minimum functionalities we need.
8081#ifndef ImVector
r244545r244546
114115    inline const value_type&    back() const                    { IM_ASSERT(Size > 0); return Data[Size-1]; }
115116    inline void                 swap(ImVector<T>& rhs)          { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
116117
118    inline void                 reserve(size_t new_capacity)    { Data = (value_type*)ImGui::MemRealloc(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
117119    inline void                 resize(size_t new_size)         { if (new_size > Capacity) reserve(new_size); Size = new_size; }
118    inline void                 reserve(size_t new_capacity)
119    {
120        if (new_capacity <= Capacity) return;
121        T* new_data = (value_type*)ImGui::MemAlloc(new_capacity * sizeof(value_type));
122        memcpy(new_data, Data, Size * sizeof(value_type));
123        ImGui::MemFree(Data);
124        Data = new_data;
125        Capacity = new_capacity;
126    }
127120
128121    inline void                 push_back(const value_type& v)  { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
129122    inline void                 pop_back()                      { IM_ASSERT(Size > 0); Size--; }
r244545r244546
159152    IMGUI_API bool          Begin(const char* name = "Debug", bool* p_opened = NULL, ImVec2 size = ImVec2(0,0), float fill_alpha = -1.0f, ImGuiWindowFlags flags = 0);// return false when window is collapsed, so you can early out in your code. passing 'bool* p_opened' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
160153    IMGUI_API void          End();
161154    IMGUI_API void          BeginChild(const char* str_id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);                         // size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). on each axis.
162    IMGUI_API void          BeginChild(ImGuiID id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);                                 // "
163155    IMGUI_API void          EndChild();
164156    IMGUI_API bool          GetWindowIsFocused();
165    IMGUI_API ImVec2        GetContentRegionMax();                                              // window or current column boundaries, in windows coordinates
166    IMGUI_API ImVec2        GetWindowContentRegionMin();                                        // window boundaries, in windows coordinates
157    IMGUI_API ImVec2        GetContentRegionMax();                                              // window or current column boundaries
158    IMGUI_API ImVec2        GetWindowContentRegionMin();                                        // window boundaries
167159    IMGUI_API ImVec2        GetWindowContentRegionMax();
168160    IMGUI_API ImDrawList*   GetWindowDrawList();                                                // get rendering command-list if you want to append your own draw primitives.
169161    IMGUI_API ImFont*       GetWindowFont();
170    IMGUI_API float         GetWindowFontSize();                                                // size (also height in pixels) of current font with current scale applied
162    IMGUI_API float         GetWindowFontSize();
171163    IMGUI_API void          SetWindowFontScale(float scale);                                    // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows.
172164    IMGUI_API ImVec2        GetWindowPos();                                                     // you should rarely need/care about the window position, but it can be useful if you want to do your own drawing.
173165    IMGUI_API ImVec2        GetWindowSize();                                                    // get current window position.
174166    IMGUI_API float         GetWindowWidth();
175167    IMGUI_API bool          GetWindowCollapsed();
168    IMGUI_API void          SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0);        // set current window position - call within Begin()/End().
169    IMGUI_API void          SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0);      // set current window size. set to ImVec2(0,0) to force an auto-fit
170    IMGUI_API void          SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0);     // set current window collapsed state.
176171    IMGUI_API void          SetNextWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0);    // set next window position - call before Begin().
177    IMGUI_API void          SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0);  // set next window size. set to ImVec2(0,0) to force an auto-fit.
172    IMGUI_API void          SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0);  // set next window size. set to ImVec2(0,0) to force an auto-fit
178173    IMGUI_API void          SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set next window collapsed state.
179    IMGUI_API void          SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0);        // set current window position - call within Begin()/End(). may incur tearing.
180    IMGUI_API void          SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0);      // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing.
181    IMGUI_API void          SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0);     // set current window collapsed state.
182174
183175    IMGUI_API void          SetScrollPosHere();                                                 // adjust scrolling position to center into the current cursor position.
184176    IMGUI_API void          SetKeyboardFocusHere(int offset = 0);                               // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget.
r244545r244546
195187    IMGUI_API void          PopStyleVar(int count = 1);
196188
197189    // Parameters stacks (current window)
198    IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -0.01f always align width to the right side)
190    IMGUI_API void          PushItemWidth(float item_width);                                    // width of items for the common item+label case. default to ~2/3 of windows width.
199191    IMGUI_API void          PopItemWidth();
200    IMGUI_API float         CalcItemWidth();                                                    // width of item given pushed settings and current cursor position
192    IMGUI_API float         GetItemWidth();
201193    IMGUI_API void          PushAllowKeyboardFocus(bool v);                                     // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.
202194    IMGUI_API void          PopAllowKeyboardFocus();
203195    IMGUI_API void          PushTextWrapPos(float wrap_pos_x = 0.0f);                           // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space.
r244545r244546
219211    IMGUI_API void          SetColumnOffset(int column_index, float offset);
220212    IMGUI_API float         GetColumnWidth(int column_index = -1);
221213    IMGUI_API ImVec2        GetCursorPos();                                                     // cursor position is relative to window position
222    IMGUI_API float         GetCursorPosX();                                                    // "
223    IMGUI_API float         GetCursorPosY();                                                    // "
224214    IMGUI_API void          SetCursorPos(const ImVec2& pos);                                    // "
225215    IMGUI_API void          SetCursorPosX(float x);                                             // "
226216    IMGUI_API void          SetCursorPosY(float y);                                             // "
227217    IMGUI_API ImVec2        GetCursorScreenPos();                                               // cursor position in absolute screen coordinates (0..io.DisplaySize)
228218    IMGUI_API void          SetCursorScreenPos(const ImVec2& pos);                              // cursor position in absolute screen coordinates (0..io.DisplaySize)
229219    IMGUI_API void          AlignFirstTextHeightToWidgets();                                    // call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets.
230    IMGUI_API float         GetTextLineHeight();                                                // height of font == GetWindowFontSize()
231    IMGUI_API float         GetTextLineHeightWithSpacing();                                     // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
220    IMGUI_API float         GetTextLineSpacing();
221    IMGUI_API float         GetTextLineHeight();
232222
233223    // ID scopes
234224    // If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
r244545r244546
248238    IMGUI_API void          TextWrapped(const char* fmt, ...);                                  // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
249239    IMGUI_API void          TextWrappedV(const char* fmt, va_list args);
250240    IMGUI_API void          TextUnformatted(const char* text, const char* text_end = NULL);     // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text.
251    IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets
241    IMGUI_API void          LabelText(const char* label, const char* fmt, ...);                 // display text+label aligned the same way as value+label widgets
252242    IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args);
253243    IMGUI_API void          BulletText(const char* fmt, ...);
254244    IMGUI_API void          BulletTextV(const char* fmt, va_list args);
r244545r244546
256246    IMGUI_API bool          SmallButton(const char* label);
257247    IMGUI_API bool          InvisibleButton(const char* str_id, const ImVec2& size);
258248    IMGUI_API void          Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
259    IMGUI_API bool          ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0),  const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1), const ImVec4& tint_col = ImVec4(1,1,1,1));    // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
249    IMGUI_API bool          ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0),  const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1));    // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
260250    IMGUI_API bool          CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
261251    IMGUI_API bool          SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);     // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders.
262252    IMGUI_API bool          SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
r244545r244546
281271    IMGUI_API bool          InputFloat3(const char* label, float v[3], int decimal_precision = -1);
282272    IMGUI_API bool          InputFloat4(const char* label, float v[4], int decimal_precision = -1);
283273    IMGUI_API bool          InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0);
284    IMGUI_API bool          Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
285    IMGUI_API bool          Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1);      // separate items with \0, end item-list with \0\0
286    IMGUI_API bool          Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
274    IMGUI_API bool          Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items = 7);
275    IMGUI_API bool          Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items = 7);      // separate items with \0, end item-list with \0\0
276    IMGUI_API bool          Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_height_items = 7);
287277    IMGUI_API bool          ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
288278    IMGUI_API bool          ColorEdit3(const char* label, float col[3]);
289279    IMGUI_API bool          ColorEdit4(const char* label, float col[4], bool show_alpha = true);
r244545r244546
298288    IMGUI_API void          TreePop();
299289    IMGUI_API void          OpenNextNode(bool open);                                            // force open/close the next TreeNode or CollapsingHeader
300290
301    // Selectable / Lists
302    IMGUI_API bool          Selectable(const char* label, bool selected, const ImVec2& size = ImVec2(0,0));
303    IMGUI_API bool          Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
304    IMGUI_API bool          ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
305    IMGUI_API bool          ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
306    IMGUI_API bool          ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards.
307    IMGUI_API bool          ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
308    IMGUI_API void          ListBoxFooter();                                                    // terminate the scrolling region
309
310291    // Value() Helpers: output single value in "name: value" format. Tip: freely declare your own within the ImGui namespace!
311292    IMGUI_API void          Value(const char* prefix, bool b);
312293    IMGUI_API void          Value(const char* prefix, int v);
r244545r244546
341322    IMGUI_API int           GetFrameCount();
342323    IMGUI_API const char*   GetStyleColName(ImGuiCol idx);
343324    IMGUI_API ImVec2        CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
344    IMGUI_API void          CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end);    // helper to manually clip large list of items. see comments in implementation.
345325
346    IMGUI_API void          BeginChildFrame(ImGuiID id, const ImVec2& size);                    // helper to create a child window / scrolling region that looks like a normal widget frame.
347    IMGUI_API void          EndChildFrame();
348
349326    IMGUI_API ImU32         ColorConvertFloat4ToU32(const ImVec4& in);
350327    IMGUI_API void          ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
351328    IMGUI_API void          ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
352329
353    // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
354    IMGUI_API void*         GetInternalState();
355    IMGUI_API size_t        GetInternalStateSize();
356    IMGUI_API void          SetInternalState(void* state, bool construct = false);
357
358330    // Obsolete (will be removed)
359331    IMGUI_API void          GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
360332
r244545r244546
364336enum ImGuiWindowFlags_
365337{
366338    // Default: 0
367    ImGuiWindowFlags_NoTitleBar             = 1 << 0,   // Disable title-bar
368    ImGuiWindowFlags_NoResize               = 1 << 1,   // Disable user resizing with the lower-right grip
369    ImGuiWindowFlags_NoMove                 = 1 << 2,   // Disable user moving the window
370    ImGuiWindowFlags_NoScrollbar            = 1 << 3,   // Disable scroll bar (window can still scroll with mouse or programatically)
371    ImGuiWindowFlags_NoScrollWithMouse      = 1 << 4,   // Disable user scrolling with mouse wheel
372    ImGuiWindowFlags_NoCollapse             = 1 << 5,   // Disable user collapsing window by double-clicking on it
373    ImGuiWindowFlags_AlwaysAutoResize       = 1 << 6,   // Resize every window to its content every frame
374    ImGuiWindowFlags_ShowBorders            = 1 << 7,   // Show borders around windows and items
375    ImGuiWindowFlags_NoSavedSettings        = 1 << 8,   // Never load/save settings in .ini file
376    // [Internal]
377    ImGuiWindowFlags_ChildWindow            = 1 << 9,   // For internal use by BeginChild()
378    ImGuiWindowFlags_ChildWindowAutoFitX    = 1 << 10,  // For internal use by BeginChild()
379    ImGuiWindowFlags_ChildWindowAutoFitY    = 1 << 11,  // For internal use by BeginChild()
380    ImGuiWindowFlags_ComboBox               = 1 << 12,  // For internal use by ComboBox()
381    ImGuiWindowFlags_Tooltip                = 1 << 13   // For internal use by BeginTooltip()
339    ImGuiWindowFlags_ShowBorders            = 1 << 0,
340    ImGuiWindowFlags_NoTitleBar             = 1 << 1,
341    ImGuiWindowFlags_NoResize               = 1 << 2,
342    ImGuiWindowFlags_NoMove                 = 1 << 3,
343    ImGuiWindowFlags_NoScrollbar            = 1 << 4,
344    ImGuiWindowFlags_NoScrollWithMouse      = 1 << 5,
345    ImGuiWindowFlags_AlwaysAutoResize       = 1 << 6,
346    ImGuiWindowFlags_NoSavedSettings        = 1 << 7,   // Never load/save settings in .ini file
347    ImGuiWindowFlags_ChildWindow            = 1 << 8,   // For internal use by BeginChild()
348    ImGuiWindowFlags_ChildWindowAutoFitX    = 1 << 9,   // For internal use by BeginChild()
349    ImGuiWindowFlags_ChildWindowAutoFitY    = 1 << 10,  // For internal use by BeginChild()
350    ImGuiWindowFlags_ComboBox               = 1 << 11,  // For internal use by ComboBox()
351    ImGuiWindowFlags_Tooltip                = 1 << 12   // For internal use by Render() when using Tooltip
382352};
383353
384354// Flags for ImGui::InputText()
r244545r244546
423393{
424394    ImGuiCol_Text,
425395    ImGuiCol_WindowBg,
426    ImGuiCol_ChildWindowBg,
427396    ImGuiCol_Border,
428397    ImGuiCol_BorderShadow,
429398    ImGuiCol_FrameBg,               // Background of checkbox, radio button, plot, slider, text input
r244545r244546
467436// NB: the enum only refers to fields of ImGuiStyle() which makes sense to be pushed/poped in UI code. Feel free to add others.
468437enum ImGuiStyleVar_
469438{
470    ImGuiStyleVar_Alpha,               // float
471    ImGuiStyleVar_WindowPadding,       // ImVec2
472    ImGuiStyleVar_WindowRounding,      // float
473    ImGuiStyleVar_ChildWindowRounding, // float
474    ImGuiStyleVar_FramePadding,        // ImVec2
475    ImGuiStyleVar_FrameRounding,       // float
476    ImGuiStyleVar_ItemSpacing,         // ImVec2
477    ImGuiStyleVar_ItemInnerSpacing,    // ImVec2
478    ImGuiStyleVar_TreeNodeSpacing      // float
439    ImGuiStyleVar_Alpha,             // float
440    ImGuiStyleVar_WindowPadding,     // ImVec2
441    ImGuiStyleVar_WindowRounding,    // float
442    ImGuiStyleVar_FramePadding,      // ImVec2
443    ImGuiStyleVar_FrameRounding,     // float
444    ImGuiStyleVar_ItemSpacing,       // ImVec2
445    ImGuiStyleVar_ItemInnerSpacing,  // ImVec2
446    ImGuiStyleVar_TreeNodeSpacing    // float
479447};
480448
481449// Enumeration for ColorEditMode()
r244545r244546
503471    ImVec2      WindowPadding;              // Padding within a window
504472    ImVec2      WindowMinSize;              // Minimum window size
505473    float       WindowRounding;             // Radius of window corners rounding. Set to 0.0f to have rectangular windows
506    float       ChildWindowRounding;        // Radius of child window corners rounding. Set to 0.0f to have rectangular windows
507474    ImVec2      FramePadding;               // Padding within a framed rectangle (used by most widgets)
508475    float       FrameRounding;              // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
509476    ImVec2      ItemSpacing;                // Horizontal and vertical spacing between widgets/lines
r244545r244546
547514    // User Functions
548515    //------------------------------------------------------------------
549516
550    // REQUIRED: rendering function.
517    // REQUIRED: rendering function.
551518    // See example code if you are unsure of how to implement this.
552    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
519    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);     
553520
554521    // Optional: access OS clipboard (default to use native Win32 clipboard on Windows, otherwise use a ImGui private clipboard)
555522    // Override to access OS clipboard on other architectures.
556523    const char* (*GetClipboardTextFn)();
557524    void        (*SetClipboardTextFn)(const char* text);
558525
559    // Optional: override memory allocations (default to posix malloc/free). MemFreeFn() may be called with a NULL pointer.
526    // Optional: override memory allocations (default to posix malloc/realloc/free)
560527    void*       (*MemAllocFn)(size_t sz);
528    void*       (*MemReallocFn)(void* ptr, size_t sz);
561529    void        (*MemFreeFn)(void* ptr);
562530
563531    // Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese inputs in Windows)
r244545r244546
569537
570538    ImVec2      MousePos;                   // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
571539    bool        MouseDown[5];               // Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
572    float       MouseWheel;                 // Mouse wheel: 1 unit scrolls about 5 lines text.
540    float       MouseWheel;                 // Mouse wheel: 1 unit scrolls about 5 lines text.
573541    bool        MouseDrawCursor;            // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
574542    bool        KeyCtrl;                    // Keyboard modifier pressed: Control
575543    bool        KeyShift;                   // Keyboard modifier pressed: Shift
r244545r244546
590558    // [Internal] ImGui will maintain those fields for you
591559    //------------------------------------------------------------------
592560
593    ImVec2      MousePosPrev;               //
594    ImVec2      MouseDelta;                 // Mouse delta. Note that this is zero if either current or previous position are negative to allow mouse enabling/disabling.
595    bool        MouseClicked[5];            // Mouse button went from !Down to Down
596    ImVec2      MouseClickedPos[5];         // Position at time of clicking
597    float       MouseClickedTime[5];        // Time of last click (used to figure out double-click)
598    bool        MouseDoubleClicked[5];      // Has mouse button been double-clicked?
599    bool        MouseDownOwned[5];          // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
600    float       MouseDownTime[5];           // Time the mouse button has been down
601    float       KeysDownTime[512];          // Time the keyboard key has been down
561    ImVec2      MousePosPrev;
562    ImVec2      MouseDelta;
563    bool        MouseClicked[5];
564    ImVec2      MouseClickedPos[5];
565    float       MouseClickedTime[5];
566    bool        MouseDoubleClicked[5];
567    float       MouseDownTime[5];
568    float       KeysDownTime[512];
602569
603570    IMGUI_API   ImGuiIO();
604571};
r244545r244546
680647// - You want to store custom debug data easily without adding or editing structures in your code.
681648struct ImGuiStorage
682649{
683    struct Pair
684    {
685        ImGuiID key;
686        union { int val_i; float val_f; void* val_p; };
687        Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
688        Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
689        Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
650    struct Pair
651    {
652        ImGuiID key;
653        union { int val_i; float val_f; void* val_p; };       
654        Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
655        Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
656        Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
690657    };
691658    ImVector<Pair>    Data;
692659
r244545r244546
701668    IMGUI_API void*   GetVoidPtr(ImGuiID key) const; // default_val is NULL
702669    IMGUI_API void    SetVoidPtr(ImGuiID key, void* val);
703670
704    // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
671    // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
705672    // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
706673    // - A typical use case where this is convenient:
707674    //      float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar;
r244545r244546
716683// Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used.
717684struct ImGuiTextEditCallbackData
718685{
719    ImGuiKey            EventKey;       // Key pressed (Up/Down/TAB)        // Read-only
686    ImGuiKey            EventKey;       // Key pressed (Up/Down/TAB)        // Read-only   
720687    char*               Buf;            // Current text                     // Read-write (pointed data only)
721688    size_t              BufSize;        //                                  // Read-only
722689    bool                BufDirty;       // Set if you modify Buf directly   // Write
r244545r244546
737704{
738705    ImVec4              Value;
739706
740    ImColor(int r, int g, int b, int a = 255)                       { Value.x = (float)r / 255.0f; Value.y = (float)g / 255.0f; Value.z = (float)b / 255.0f; Value.w = (float)a / 255.0f; }
707    ImColor(int r, int g, int b, int a = 255)                       { Value.x = r / 255.0f; Value.y = g / 255.0f; Value.z = b / 255.0f; Value.w = a / 255.0f; }
741708    ImColor(float r, float g, float b, float a = 1.0f)              { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
742709    ImColor(const ImVec4& col)                                      { Value = col; }
743710
r244545r244546
802769
803770    // [Internal to ImGui]
804771    ImVector<ImVec4>        clip_rect_stack;    // [Internal]
805    ImVector<ImTextureID>   texture_id_stack;   // [Internal]
772    ImVector<ImTextureID>   texture_id_stack;   // [Internal]
806773    ImDrawVert*             vtx_write;          // [Internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
807774
808775    ImDrawList() { Clear(); }
809776    IMGUI_API void  Clear();
810    IMGUI_API void  PushClipRect(const ImVec4& clip_rect);          // Scissoring. The values are x1, y1, x2, y2.
777    IMGUI_API void  PushClipRect(const ImVec4& clip_rect);
811778    IMGUI_API void  PopClipRect();
812779    IMGUI_API void  PushTextureID(const ImTextureID& texture_id);
813780    IMGUI_API void  PopTextureID();
814781
815    // Primitives
782    // Primitives   
816783    IMGUI_API void  AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
817784    IMGUI_API void  AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
818785    IMGUI_API void  AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
r244545r244546
820787    IMGUI_API void  AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
821788    IMGUI_API void  AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
822789    IMGUI_API void  AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris = false, const ImVec2& third_point_offset = ImVec2(0,0));
823    IMGUI_API void  AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL);
790    IMGUI_API void  AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f);
824791    IMGUI_API void  AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
825792
826793    // Advanced
r244545r244546
925892    // 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
926893    IMGUI_API ImVec2                CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8
927894    IMGUI_API ImVec2                CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const;                 // wchar
928    IMGUI_API void                  RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
895    IMGUI_API void                  RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f) const;
929896    IMGUI_API const char*           CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
930897};
931898
branches/kale/3rdparty/bgfx/README.md
r244545r244546
5252http://airmech.com/ AirMech is a free-to-play futuristic action real-time
5353strategy video game developed and published by Carbon Games.
5454
55http://loomsdk.com/ Loom Game Engine developed by The Engine Company. Loom
55http://theengine.co/ Loom Game Engine developed by The Engine Company. Loom
5656is a powerful 2D game engine with live reloading of code and assets, a friendly
57scripting language, and an efficient command-line workflow.
57scripting language, and an efficient command-line workflow. Here is video where
58they explain why they choose bgfx over alternatives: 
59<a href="https://www.youtube.com/watch?feature=player_embedded&v=PHY_XHkMGIM&t=1m53s" target="_blank"><img src="https://img.youtube.com/vi/PHY_XHkMGIM/0.jpg" alt="Why did you choose bgfx?" width="240" height="180" border="10" /></a>
5860
5961https://github.com/dariomanesku/cmftStudio cmftStudio - cubemap filtering tool. 
6062![cmftStudio](https://github.com/dariomanesku/cmftStudio/raw/master/screenshots/cmftStudio_small.jpg)
r244545r244546
6971how it currently looks. 
7072![mac_screenshot](https://raw.githubusercontent.com/emoon/ProDBG/master/data/screens/mac_screenshot.png)
7173
72
73http://www.dogbytegames.com/ Dogbyte Games is an indie mobile developer studio
74focusing on racing games.
75
7674Examples
7775--------
7876
r244545r244546
308306Building
309307--------
310308
311Steps bellow are for default build system inside bgfx repository. There is
312alterative way to build bgfx and examples with [fips](https://github.com/floooh/fips-bgfx/#fips-bgfx).
313
314309### Prerequisites
315310
316311Windows users download GnuWin32 utilities from: 
r244545r244546
746741Kai Jourdan ([@questor](https://github.com/questor)) - 23-vectordisplay example 
747742Stanlo Slasinski ([@stanlo](https://github.com/stanlo)) - 24-nbody example 
748743Daniel Collin ([@emoon](https://github.com/emoon)) - Port of Ocornut's ImGui
749  to bgfx. 
750Andre Weissflog ([@floooh](https://github.com/floooh)) - Alternative build
751system fips.
744  to bgfx.
752745
753746[License (BSD 2-clause)](https://github.com/bkaradzic/bgfx/blob/master/LICENSE)
754747-------------------------------------------------------------------------------
branches/kale/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
r244545r244546
495495      break;
496496
497497   case bgfx::RendererType::Direct3D11:
498   case bgfx::RendererType::Direct3D12:
499498      vs_metaballs = bgfx::makeRef(vs_metaballs_dx11, sizeof(vs_metaballs_dx11) );
500499      fs_metaballs = bgfx::makeRef(fs_metaballs_dx11, sizeof(fs_metaballs_dx11) );
501500      break;
r244545r244546
545544
546545      float at[3]  = { 0.0f, 0.0f,   0.0f };
547546      float eye[3] = { 0.0f, 0.0f, -50.0f };
548
547     
549548      // Set view and projection matrix for view 0.
550549      const bgfx::HMD* hmd = bgfx::getHMD();
551550      if (NULL != hmd)
r244545r244546
599598      }
600599
601600      profUpdate = bx::getHPCounter();
602
601     
603602      for (uint32_t zz = 0; zz < DIMS; ++zz)
604603      {
605604         for (uint32_t yy = 0; yy < DIMS; ++yy)
r244545r244546
691690                  -DIMS*0.5f + float(zz)
692691               };
693692
694               const Grid* val[8] = {
693               const Grid* val[8] = {
695694                  &grid[xoffset+zpitch+ypitch  ],
696695                  &grid[xoffset+zpitch+ypitch+1],
697696                  &grid[xoffset+ypitch+1       ],
r244545r244546
736735      bgfx::dbgTextPrintf(1, 7, 0x0f, " Triangulate: % 7.3f[ms]", double(profTriangulate)*toMs);
737736      bgfx::dbgTextPrintf(1, 8, 0x0f, "       Frame: % 7.3f[ms]", double(frameTime)*toMs);
738737
739      // Advance to next frame. Rendering thread will be kicked to
738      // Advance to next frame. Rendering thread will be kicked to
740739      // process submitted rendering primitives.
741740      bgfx::frame();
742741   }
branches/kale/3rdparty/bgfx/examples/08-update/update.cpp
r244545r244546
8484    9, 10, 11,
8585
8686   12, 14, 13, // 6
87   14, 15, 13,
87   14, 15, 13,
8888
8989   16, 18, 17, // 8
9090   18, 19, 17,
r244545r244546
9696static void updateTextureCubeRectBgra8(bgfx::TextureHandle _handle, uint8_t _side, uint32_t _x, uint32_t _y, uint32_t _width, uint32_t _height, uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a = 0xff)
9797{
9898   bgfx::TextureInfo ti;
99   bgfx::calcTextureSize(ti, _width, _height, 1, 1, false, bgfx::TextureFormat::BGRA8);
99   bgfx::calcTextureSize(ti, _width, _height, 1, 1, bgfx::TextureFormat::BGRA8);
100100
101101   const bgfx::Memory* mem = bgfx::alloc(ti.storageSize);
102102   uint8_t* data = (uint8_t*)mem->data;
r244545r244546
285285
286286      float at[3] = { 0.0f, 0.0f, 0.0f };
287287      float eye[3] = { 0.0f, 0.0f, -5.0f };
288
288     
289289      float view[16];
290290      float proj[16];
291291      bx::mtxLookAt(view, eye, at);
r244545r244546
394394         bgfx::submit(1);
395395      }
396396
397      // Advance to next frame. Rendering thread will be kicked to
397      // Advance to next frame. Rendering thread will be kicked to
398398      // process submitted rendering primitives.
399399      bgfx::frame();
400400   }
branches/kale/3rdparty/bgfx/examples/13-stencil/stencil.cpp
r244545r244546
146146   1, 3, 2,
147147};
148148
149static const char* s_shaderPath = NULL;
149150static bool s_flipV = false;
150151static uint32_t s_viewMask = 0;
151152static uint32_t s_clearMask = 0;
r244545r244546
856857   // for each renderer.
857858   switch (bgfx::getRendererType() )
858859   {
860   default:
861   case bgfx::RendererType::Direct3D9:
862      s_shaderPath = "shaders/dx9/";
863      break;
864
865   case bgfx::RendererType::Direct3D11:
866      s_shaderPath = "shaders/dx11/";
867      break;
868
859869   case bgfx::RendererType::OpenGL:
860   case bgfx::RendererType::OpenGLES:
870      s_shaderPath = "shaders/glsl/";
861871      s_flipV = true;
862872      break;
863873
864   default:
874   case bgfx::RendererType::OpenGLES:
875      s_shaderPath = "shaders/gles/";
876      s_flipV = true;
865877      break;
866878   }
867879
branches/kale/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
r244545r244546
111111   1, 3, 2,
112112};
113113
114static const char* s_shaderPath = NULL;
114115static bool s_oglNdc = false;
115116static float s_texelHalf = 0.0f;
116117
r244545r244546
18711872   // for each renderer.
18721873   switch (bgfx::getRendererType() )
18731874   {
1875   default:
18741876   case bgfx::RendererType::Direct3D9:
1877      s_shaderPath = "shaders/dx9/";
18751878      s_texelHalf = 0.5f;
18761879      break;
18771880
1881   case bgfx::RendererType::Direct3D11:
1882      s_shaderPath = "shaders/dx11/";
1883      break;
1884
18781885   case bgfx::RendererType::OpenGL:
1879   case bgfx::RendererType::OpenGLES:
1886      s_shaderPath = "shaders/glsl/";
18801887      s_oglNdc = true;
18811888      break;
18821889
1883   default:
1890   case bgfx::RendererType::OpenGLES:
1891      s_shaderPath = "shaders/gles/";
1892      s_oglNdc = true;
18841893      break;
18851894   }
18861895
branches/kale/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
r244545r244546
220220   1, 3, 2,
221221};
222222
223static const char* s_shaderPath = NULL;
223224static bool s_flipV = false;
224225static float s_texelHalf = 0.0f;
225226
r244545r244546
13321333   // for each renderer.
13331334   switch (bgfx::getRendererType() )
13341335   {
1336   default:
13351337   case bgfx::RendererType::Direct3D9:
1338      s_shaderPath = "shaders/dx9/";
13361339      s_texelHalf = 0.5f;
13371340      break;
13381341
1342   case bgfx::RendererType::Direct3D11:
1343      s_shaderPath = "shaders/dx11/";
1344      break;
1345
13391346   case bgfx::RendererType::OpenGL:
1340   case bgfx::RendererType::OpenGLES:
1347      s_shaderPath = "shaders/glsl/";
13411348      s_flipV = true;
13421349      break;
13431350
1344   default:
1351   case bgfx::RendererType::OpenGLES:
1352      s_shaderPath = "shaders/gles/";
1353      s_flipV = true;
13451354      break;
13461355   }
13471356
branches/kale/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
r244545r244546
280280         break;
281281
282282      case bgfx::RendererType::Direct3D11:
283      case bgfx::RendererType::Direct3D12:
284283         vs_drawstress = bgfx::makeRef(vs_drawstress_dx11, sizeof(vs_drawstress_dx11) );
285284         fs_drawstress = bgfx::makeRef(fs_drawstress_dx11, sizeof(fs_drawstress_dx11) );
286285         break;
branches/kale/3rdparty/bgfx/examples/18-ibl/ibl.cpp
r244545r244546
285285      bool m_specularIbl;
286286      bool m_showDiffColorWheel;
287287      bool m_showSpecColorWheel;
288      ImguiCubemap::Enum m_crossCubemapPreview;
288      bool m_crossCubemapPreview;
289289   };
290290
291291   Settings settings;
r244545r244546
305305   settings.m_specularIbl = true;
306306   settings.m_showDiffColorWheel = true;
307307   settings.m_showSpecColorWheel = false;
308   settings.m_crossCubemapPreview = ImguiCubemap::Cross;
308   settings.m_crossCubemapPreview = false;
309309
310310   float time = 0.0f;
311311
r244545r244546
324324         );
325325
326326      static int32_t rightScrollArea = 0;
327      imguiBeginScrollArea("Settings", width - 256 - 10, 10, 256, 540, &rightScrollArea);
327      imguiBeginScrollArea("Settings", width - 256 - 10, 10, 256, 590, &rightScrollArea);
328328
329329      imguiLabel("Shade:");
330330      imguiSeparator();
r244545r244546
350350                                          , "Grace"
351351                                          ) );
352352      static float lod = 0.0f;
353      if (imguiCube(lightProbes[currentLightProbe].m_tex, lod, settings.m_crossCubemapPreview, true) )
353      if (imguiCube(lightProbes[currentLightProbe].m_tex, lod, settings.m_crossCubemapPreview))
354354      {
355         settings.m_crossCubemapPreview = ImguiCubemap::Enum( (settings.m_crossCubemapPreview+1) % ImguiCubemap::Count);
355         settings.m_crossCubemapPreview = !settings.m_crossCubemapPreview;
356356      }
357357      imguiSlider("Texture LOD", lod, float(0.0f), 10.1f, 0.1f);
358358
branches/kale/3rdparty/bgfx/examples/common/bgfx_utils.cpp
r244545r244546
55
66#include <string.h> // strlen
77
8#include "common.h"
9
108#include <tinystl/allocator.h>
119#include <tinystl/vector.h>
1210#include <tinystl/string.h>
r244545r244546
7169   switch (bgfx::getRendererType() )
7270   {
7371   case bgfx::RendererType::Direct3D11:
74   case bgfx::RendererType::Direct3D12:
7572      shaderPath = "shaders/dx11/";
7673      break;
7774
branches/kale/3rdparty/bgfx/examples/common/common.h
r244545r244546
33 * License: http://www.opensource.org/licenses/BSD-2-Clause
44 */
55
6#ifndef COMMON_H_HEADER_GUARD
7#define COMMON_H_HEADER_GUARD
8
96#include <bx/timer.h>
107#include <bx/fpumath.h>
118
129#include "entry/entry.h"
13
14#endif // COMMON_H_HEADER_GUARD
branches/kale/3rdparty/bgfx/examples/common/cube_atlas.cpp
r244545r244546
6060      int32_t width; //< The line _width. The ending coordinate (inclusive) will be x+width-1.
6161   };
6262
63
64   uint32_t m_width;            //< width (in pixels) of the underlying texture
63   
64   uint32_t m_width;            //< width (in pixels) of the underlying texture   
6565   uint32_t m_height;           //< height (in pixels) of the underlying texture
6666   uint32_t m_usedSpace;        //< Surface used in squared pixel
6767   std::vector<Node> m_skyline; //< node of the skyline algorithm
r244545r244546
326326      break;
327327
328328   case bgfx::RendererType::Direct3D11:
329   case bgfx::RendererType::Direct3D12:
330329      m_texelOffset[0] = texelHalf;
331330      m_texelOffset[1] = texelHalf;
332331      break;
branches/kale/3rdparty/bgfx/examples/common/entry/cmd.cpp
r244545r244546
77#include <stdint.h>
88#include <stdlib.h> // size_t
99#include <string.h> // strlen
10
11#include <bx/allocator.h>
1210#include <bx/hash.h>
1311#include <bx/tokenizecmd.h>
1412
1513#include "dbg.h"
1614#include "cmd.h"
17#include "entry_p.h"
1815
1916#include <tinystl/allocator.h>
2017#include <tinystl/string.h>
r244545r244546
9289   CmdLookup m_lookup;
9390};
9491
95static CmdContext* s_cmdContext;
92static CmdContext s_cmdContext;
9693
97void cmdInit()
98{
99   s_cmdContext = BX_NEW(entry::getAllocator(), CmdContext);
100}
101
102void cmdShutdown()
103{
104   BX_DELETE(entry::getAllocator(), s_cmdContext);
105}
106
10794void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData)
10895{
109   s_cmdContext->add(_name, _fn, _userData);
96   s_cmdContext.add(_name, _fn, _userData);
11097}
11198
11299void cmdExec(const char* _cmd)
113100{
114   s_cmdContext->exec(_cmd);
101   s_cmdContext.exec(_cmd);
115102}
branches/kale/3rdparty/bgfx/examples/common/entry/cmd.h
r244545r244546
99struct CmdContext;
1010typedef int (*ConsoleFn)(CmdContext* _context, void* _userData, int _argc, char const* const* _argv);
1111
12///
13void cmdInit();
14
15///
16void cmdShutdown();
17
18///
1912void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData = NULL);
20
21///
2213void cmdExec(const char* _cmd);
2314
2415#endif // CMD_H_HEADER_GUARD
branches/kale/3rdparty/bgfx/examples/common/entry/entry.cpp
r244545r244546
2222   static bool s_exit = false;
2323   static bx::FileReaderI* s_fileReader = NULL;
2424   static bx::FileWriterI* s_fileWriter = NULL;
25   static bx::CrtAllocator s_allocator;
2526
26   extern bx::ReallocatorI* getDefaultAllocator();
27   static bx::ReallocatorI* s_allocator = getDefaultAllocator();
28
29#if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
30   bx::ReallocatorI* getDefaultAllocator()
31   {
32      static bx::CrtAllocator s_allocator;
33      return &s_allocator;
34   }
35#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
36
3727   bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv)
3828   {
3929      if (0 == strcmp(_argv[_first], _name) )
r244545r244546
147137      s_fileWriter = new bx::CrtFileWriter;
148138#endif // BX_CONFIG_CRT_FILE_READER_WRITER
149139
150      cmdInit();
151140      cmdAdd("mouselock", cmdMouseLock);
152141      cmdAdd("graphics",  cmdGraphics );
153142      cmdAdd("exit",      cmdExit     );
154143
155      inputInit();
156144      inputAddBindings("bindings", s_bindings);
157145
158146      entry::WindowHandle defaultWindow = { 0 };
r244545r244546
160148
161149      int32_t result = ::_main_(_argc, _argv);
162150
163      inputRemoveBindings("bindings");
164      inputShutdown();
165
166      cmdShutdown();
167
168151#if BX_CONFIG_CRT_FILE_READER_WRITER
169152      delete s_fileReader;
170153      s_fileReader = NULL;
r244545r244546
465448
466449   bx::ReallocatorI* getAllocator()
467450   {
468      return s_allocator;
451      return &s_allocator;
469452   }
470453
471   void* TinyStlAllocator::static_allocate(size_t _bytes)
472   {
473      return BX_ALLOC(getAllocator(), _bytes);
474   }
475
476   void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/)
477   {
478      if (NULL != _ptr)
479      {
480         BX_FREE(getAllocator(), _ptr);
481      }
482   }
483
484454} // namespace entry
485455
486456extern "C" bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset)
branches/kale/3rdparty/bgfx/examples/common/entry/entry_osx.mm
r244545r244546
5757
5858      static int32_t threadFunc(void* _userData)
5959      {
60         CFBundleRef mainBundle = CFBundleGetMainBundle();
61         if ( mainBundle != nil )
62         {
63            CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
64            if ( resourcesURL != nil )
65            {
66               char path[PATH_MAX];
67               if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
68               {
69                  chdir(path);
70               }
71               CFRelease(resourcesURL);
72            }
73         }
74
60            CFBundleRef mainBundle = CFBundleGetMainBundle();
61            if ( mainBundle != nil )
62            {
63                CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
64                if ( resourcesURL != nil )
65                {
66                    char path[PATH_MAX];
67                    if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
68                    {
69                        chdir(path);
70                    }
71                    CFRelease(resourcesURL);
72                }
73            }
74           
7575         MainThreadEntry* self = (MainThreadEntry*)_userData;
7676         return main(self->m_argc, self->m_argv);
7777      }
branches/kale/3rdparty/bgfx/examples/common/entry/entry_p.h
r244545r244546
66#ifndef ENTRY_PRIVATE_H_HEADER_GUARD
77#define ENTRY_PRIVATE_H_HEADER_GUARD
88
9#define TINYSTL_ALLOCATOR entry::TinyStlAllocator
10
119#include <bx/spscqueue.h>
1210
1311#include "entry.h"
r244545r244546
3937#   error "Both ENTRY_DEFAULT_WIDTH and ENTRY_DEFAULT_HEIGHT must be defined."
4038#endif // ENTRY_DEFAULT_WIDTH
4139
42#ifndef ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
43#   define ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR 1
44#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
45
4640#define ENTRY_IMPLEMENT_EVENT(_class, _type) \
4741         _class(WindowHandle _handle) : Event(_type, _handle) {}
4842
4943namespace entry
5044{
51   struct TinyStlAllocator
52   {
53      static void* static_allocate(size_t _bytes);
54      static void static_deallocate(void* _ptr, size_t /*_bytes*/);
55   };
56
5745   int main(int _argc, char** _argv);
5846
5947   struct Event
branches/kale/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
r244545r244546
1010#define XK_MISCELLANY
1111#define XK_LATIN1
1212#include <X11/keysymdef.h>
13#include <X11/Xlib.h> // will include X11 which #defines None... Don't mess with order of includes.
14#include <bgfxplatform.h>
13#include <bgfxplatform.h> // will include X11 which #defines None... Don't mess with order of includes.
1514
1615#undef None
1716#include <bx/thread.h>
branches/kale/3rdparty/bgfx/examples/common/entry/input.cpp
r244545r244546
88#include "entry_p.h"
99#include "input.h"
1010
11#include <bx/allocator.h>
1211#include <bx/ringbuffer.h>
1312#include <tinystl/allocator.h>
1413#include <tinystl/unordered_map.h>
r244545r244546
250249   Gamepad m_gamepad[ENTRY_CONFIG_MAX_GAMEPADS];
251250};
252251
253static Input* s_input;
252static Input s_input;
254253
255void inputInit()
256{
257   s_input = BX_NEW(entry::getAllocator(), Input);
258}
259
260void inputShutdown()
261{
262   BX_DELETE(entry::getAllocator(), s_input);
263}
264
265254void inputAddBindings(const char* _name, const InputBinding* _bindings)
266255{
267   s_input->addBindings(_name, _bindings);
256   s_input.addBindings(_name, _bindings);
268257}
269258
270259void inputRemoveBindings(const char* _name)
271260{
272   s_input->removeBindings(_name);
261   s_input.removeBindings(_name);
273262}
274263
275264void inputProcess()
276265{
277   s_input->process();
266   s_input.process();
278267}
279268
280269void inputSetMouseResolution(uint16_t _width, uint16_t _height)
281270{
282   s_input->m_mouse.setResolution(_width, _height);
271   s_input.m_mouse.setResolution(_width, _height);
283272}
284273
285274void inputSetKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down)
286275{
287   s_input->m_keyboard.setKeyState(_key, _modifiers, _down);
276   s_input.m_keyboard.setKeyState(_key, _modifiers, _down);
288277}
289278
290279void inputChar(uint8_t _len, const uint8_t _char[4])
291280{
292   s_input->m_keyboard.pushChar(_len, _char);
281   s_input.m_keyboard.pushChar(_len, _char);
293282}
294283
295284const uint8_t* inputGetChar()
296285{
297   return s_input->m_keyboard.popChar();
286   return s_input.m_keyboard.popChar();
298287}
299288
300289void inputCharFlush()
301290{
302   s_input->m_keyboard.charFlush();
291   s_input.m_keyboard.charFlush();
303292}
304293
305294void inputSetMousePos(int32_t _mx, int32_t _my, int32_t _mz)
306295{
307   s_input->m_mouse.setPos(_mx, _my, _mz);
296   s_input.m_mouse.setPos(_mx, _my, _mz);
308297}
309298
310299void inputSetMouseButtonState(entry::MouseButton::Enum _button, uint8_t _state)
311300{
312   s_input->m_mouse.setButtonState(_button, _state);
301   s_input.m_mouse.setButtonState(_button, _state);
313302}
314303
315304void inputGetMouse(float _mouse[3])
316305{
317   _mouse[0] = s_input->m_mouse.m_norm[0];
318   _mouse[1] = s_input->m_mouse.m_norm[1];
319   _mouse[2] = s_input->m_mouse.m_norm[2];
320   s_input->m_mouse.m_norm[0] = 0.0f;
321   s_input->m_mouse.m_norm[1] = 0.0f;
322   s_input->m_mouse.m_norm[2] = 0.0f;
306   _mouse[0] = s_input.m_mouse.m_norm[0];
307   _mouse[1] = s_input.m_mouse.m_norm[1];
308   _mouse[2] = s_input.m_mouse.m_norm[2];
309   s_input.m_mouse.m_norm[0] = 0.0f;
310   s_input.m_mouse.m_norm[1] = 0.0f;
311   s_input.m_mouse.m_norm[2] = 0.0f;
323312}
324313
325314bool inputIsMouseLocked()
326315{
327   return s_input->m_mouse.m_lock;
316   return s_input.m_mouse.m_lock;
328317}
329318
330319void inputSetMouseLock(bool _lock)
331320{
332   if (s_input->m_mouse.m_lock != _lock)
321   if (s_input.m_mouse.m_lock != _lock)
333322   {
334      s_input->m_mouse.m_lock = _lock;
323      s_input.m_mouse.m_lock = _lock;
335324      entry::WindowHandle defaultWindow = { 0 };
336325      entry::setMouseLock(defaultWindow, _lock);
337326      if (_lock)
338327      {
339         s_input->m_mouse.m_norm[0] = 0.0f;
340         s_input->m_mouse.m_norm[1] = 0.0f;
341         s_input->m_mouse.m_norm[2] = 0.0f;
328         s_input.m_mouse.m_norm[0] = 0.0f;
329         s_input.m_mouse.m_norm[1] = 0.0f;
330         s_input.m_mouse.m_norm[2] = 0.0f;
342331      }
343332   }
344333}
345334
346335void inputSetGamepadAxis(entry::GamepadHandle _handle, entry::GamepadAxis::Enum _axis, int32_t _value)
347336{
348   s_input->m_gamepad[_handle.idx].setAxis(_axis, _value);
337   s_input.m_gamepad[_handle.idx].setAxis(_axis, _value);
349338}
350339
351340int32_t inputGetGamepadAxis(entry::GamepadHandle _handle, entry::GamepadAxis::Enum _axis)
352341{
353   return s_input->m_gamepad[_handle.idx].getAxis(_axis);
342   return s_input.m_gamepad[_handle.idx].getAxis(_axis);
354343}
branches/kale/3rdparty/bgfx/examples/common/entry/input.h
r244545r244546
2222#define INPUT_BINDING_END { entry::Key::None, entry::Modifier::None, 0, NULL, NULL }
2323
2424///
25void inputInit();
26
27///
28void inputShutdown();
29
30///
3125void inputAddBindings(const char* _name, const InputBinding* _bindings);
3226
3327///
branches/kale/3rdparty/bgfx/examples/common/font/font_manager.cpp
r244545r244546
1313
1414BX_PRAGMA_DIAGNOSTIC_PUSH();
1515BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4245) // error C4245: '=' : conversion from 'int' to 'FT_UInt', signed/unsigned mismatch
16#if BX_COMPILER_MSVC || BX_COMPILER_GCC >= 40300
1716#pragma push_macro("interface")
18#endif
1917#undef interface
2018#include <freetype/freetype.h>
21#if BX_COMPILER_MSVC || BX_COMPILER_GCC >= 40300
2219#pragma pop_macro("interface")
23#endif
2420BX_PRAGMA_DIAGNOSTIC_POP();
2521
2622#include "../common.h"
branches/kale/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
r244545r244546
7474   /// Append a wide char unicode string to the buffer using current pen
7575   /// position and color.
7676   void appendText(FontHandle _fontHandle, const wchar_t* _string, const wchar_t* _end = NULL);
77
77   
7878   /// Append a whole face of the atlas cube, mostly used for debugging
7979   /// and visualizing atlas.
8080   void appendAtlasFace(uint16_t _faceIndex);
r244545r244546
250250      }
251251   }
252252
253   BX_CHECK(state == UTF8_ACCEPT, "The string is not well-formed");
253   BX_CHECK(state == UTF8_ACCEPT, "The string is not well-formed");   
254254}
255255
256256void TextBuffer::appendText(FontHandle _fontHandle, const wchar_t* _string, const wchar_t* _end)
r244545r244546
366366
367367      float txtDecals = (font.ascender - m_lineAscender);
368368      m_lineAscender = font.ascender;
369      m_lineGap = font.lineGap;
369      m_lineGap = font.lineGap;     
370370      verticalCenterLastLine( (txtDecals), (m_penY - m_lineAscender), (m_penY + m_lineAscender - m_lineDescender + m_lineGap) );
371371   }
372372
r244545r244546
575575      break;
576576
577577   case bgfx::RendererType::Direct3D11:
578   case bgfx::RendererType::Direct3D12:
579578      vs_font_basic = bgfx::makeRef(vs_font_basic_dx11, sizeof(vs_font_basic_dx11) );
580579      fs_font_basic = bgfx::makeRef(fs_font_basic_dx11, sizeof(fs_font_basic_dx11) );
581580      vs_font_distance_field = bgfx::makeRef(vs_font_distance_field_dx11, sizeof(vs_font_distance_field_dx11) );
branches/kale/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
r244545r244546
1static const uint8_t fs_imgui_latlong_glsl[646] =
2{
3   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
4   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
5   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
6   0x00, 0x01, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...N...varying h
7   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
8   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
9   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
10   0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni
11   0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // form lowp sample
12   0x72, 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // rCube s_texColor
13   0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{
14   0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, // .  highp vec3 re
15   0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // sult_1;.  highp
16   0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // float tmpvar_2;.
17   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, //   tmpvar_2 = (v_
18   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, // texcoord0.x * 6.
19   0x32, 0x38, 0x33, 0x31, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 28319);.  highp
20   0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, // float tmpvar_3;.
21   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, //   tmpvar_3 = (v_
22   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
23   0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);.  result
24   0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // _1.x = (sin(tmpv
25   0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, // ar_3) * cos(tmpv
26   0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // ar_2));.  result
27   0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _1.y = cos(tmpva
28   0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, // r_3);.  result_1
29   0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // .z = (-(sin(tmpv
30   0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, // ar_3)) * sin(tmp
31   0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // var_2));.  lowp
32   0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec4 tmpvar_4;.
33   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, //  tmpvar_4.xyz =
34   0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, // textureCubeLod
35   0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, //   (s_texColor, r
36   0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, // esult_1, u_image
37   0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, // LodEnabled.x).xy
38   0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;.  tmpvar_4.w
39   0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, // = (0.2 + (0.8 *
40   0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
41   0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // d.y));.  gl_Frag
42   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // Color = tmpvar_4
43   0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                             // ;.}...
44};
45static const uint8_t fs_imgui_latlong_dx9[553] =
46{
47   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
48   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x01, 0x00, 0x00, // geLodEnabled....
49   0x01, 0x00, 0x04, 0x02, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
50   0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
51   0x1c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
52   0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
53   0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // `...........t...
54   0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, // ....s_texColor..
55   0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
56   0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
57   0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, // d...............
58   0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
59   0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
60   0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
61   0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
62   0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0xc0, // .......?...@..I.
63   0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, // ....Q.........L?
64   0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, // ..L>............
65   0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, // ................
66   0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0xa0, // ................
67   0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
68   0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
69   0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
70   0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0x00, 0xa0, // ..........U.....
71   0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
72   0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
73   0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
74   0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0x80, // ..............U.
75   0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0x81, // ..........U...U.
76   0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
77   0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
78   0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
79   0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, // ..............U.
80   0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, // ..........U.....
81   0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00,                                           // ..U......
82};
83static const uint8_t fs_imgui_latlong_dx11[600] =
84{
85   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
86   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x00, 0x30, 0x0a, // geLodEnabled..0.
87   0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x89, 0x11, 0x25, 0xa6, 0xf5, 0x66, 0x12, 0x3f, // ..0.DXBC..%..f.?
88   0xc0, 0x1f, 0x67, 0x9b, 0x6e, 0x4e, 0xac, 0x03, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // ..g.nN......0...
89   0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
90   0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
91   0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
92   0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
93   0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
94   0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC
95   0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // OORD....OSGN,...
96   0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
97   0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
98   0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
99   0x70, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // p...@.......Y...
100   0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // F. .........Z...
101   0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X0...p..
102   0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
103   0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
104   0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
105   0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@..
106   0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@..I@........
107   0x4d, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
108   0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, // ....A.......M...
109   0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x16, 0x05, 0x10, 0x00, // 2...............
110   0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, 0x00, // ....M.......b...
111   0x02, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
112   0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
113   0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........8.......
114   0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
115   0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
116   0x86, 0x03, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F~......
117   0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
118   0xa3, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
119   0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
120   0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, // ...... .........
121   0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, // .@....L?.@....L>
122   0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x0a,                                                 // >.....@.
123};
branches/kale/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
r244545r244546
1$input v_texcoord0
2
3/*
4 * Copyright 2014-2015 Dario Manesku. All rights reserved.
5 * License: http://www.opensource.org/licenses/BSD-2-Clause
6 */
7
8#include <bgfx_shader.sh>
9
10uniform vec4 u_imageLodEnabled;
11SAMPLERCUBE(s_texColor, 0);
12
13#define u_imageLod     u_imageLodEnabled.x
14#define u_imageEnabled u_imageLodEnabled.y
15
16vec3 vecFromLatLong(vec2 _uv)
17{
18   float pi    = 3.14159265;
19   float twoPi = 2.0*pi;
20   float phi   = _uv.x * twoPi;
21   float theta = _uv.y *pi;
22
23   vec3 result;
24   result.x = sin(theta)*cos(phi);
25   result.y = cos(theta);
26   result.z = -sin(theta)*sin(phi);
27
28   return result;
29}
30
31void main()
32{
33   vec3 dir = vecFromLatLong(v_texcoord0);
34   vec3 color = textureCubeLod(s_texColor, dir, u_imageLod).xyz;
35   float alpha = 0.2 + 0.8*u_imageEnabled;
36
37   gl_FragColor = vec4(color, alpha);
38}
branches/kale/3rdparty/bgfx/examples/common/imgui/imgui.cpp
r244545r244546
4141#include "fs_imgui_texture.bin.h"
4242#include "vs_imgui_cubemap.bin.h"
4343#include "fs_imgui_cubemap.bin.h"
44#include "vs_imgui_latlong.bin.h"
45#include "fs_imgui_latlong.bin.h"
4644#include "vs_imgui_image.bin.h"
4745#include "fs_imgui_image.bin.h"
4846#include "fs_imgui_image_swizz.bin.h"
r244545r244546
6765static const int32_t AREA_HEADER = 20;
6866static const float s_tabStops[4] = {150, 210, 270, 330};
6967
70// For a custom allocator, define this and implement imguiMalloc and imguiFree somewhere in the project.
71#ifndef IMGUI_CONFIG_CUSTOM_ALLOCATOR
72#   define IMGUI_CONFIG_CUSTOM_ALLOCATOR 0
73#endif // ENTRY_CONFIG_USE_TINYSTL
68static void* imguiMalloc(size_t size, void* /*_userptr*/)
69{
70   return malloc(size);
71}
7472
75#if IMGUI_CONFIG_CUSTOM_ALLOCATOR
76   void* imguiMalloc(size_t size, void* /*_userptr*/);
77   void imguiFree(void* _ptr, void* /*_userptr*/);
78#else
79   static void* imguiMalloc(size_t _size, void* /*_userptr*/)
80   {
81      return malloc(_size);
82   }
73static void imguiFree(void* _ptr, void* /*_userptr*/)
74{
75   free(_ptr);
76}
8377
84   static void imguiFree(void* _ptr, void* /*_userptr*/)
85   {
86      free(_ptr);
87   }
88#endif //IMGUI_CONFIG_CUSTOM_ALLOCATOR
89
9078#define IMGUI_MIN(_a, _b) (_a)<(_b)?(_a):(_b)
9179#define IMGUI_MAX(_a, _b) (_a)>(_b)?(_a):(_b)
9280#define IMGUI_CLAMP(_a, _min, _max) IMGUI_MIN(IMGUI_MAX(_a, _min), _max)
r244545r244546
405393      m_colorProgram.idx      = bgfx::invalidHandle;
406394      m_textureProgram.idx    = bgfx::invalidHandle;
407395      m_cubeMapProgram.idx    = bgfx::invalidHandle;
408      m_latlongProgram.idx    = bgfx::invalidHandle;
409396      m_imageProgram.idx      = bgfx::invalidHandle;
410397      m_imageSwizzProgram.idx = bgfx::invalidHandle;
411398   }
r244545r244546
468455      IMGUI_create(_data, _size, _fontSize);
469456
470457      m_nvg = nvgCreate(1, m_view);
471       nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
472       nvgFontSize(m_nvg, _fontSize);
473       nvgFontFace(m_nvg, "default");
458      nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
459      nvgFontSize(m_nvg, _fontSize);
460      nvgFontFace(m_nvg, "default");
474461
475462      for (int32_t ii = 0; ii < NUM_CIRCLE_VERTS; ++ii)
476463      {
r244545r244546
494481      const bgfx::Memory* fs_imgui_texture;
495482      const bgfx::Memory* vs_imgui_cubemap;
496483      const bgfx::Memory* fs_imgui_cubemap;
497      const bgfx::Memory* vs_imgui_latlong;
498      const bgfx::Memory* fs_imgui_latlong;
499484      const bgfx::Memory* vs_imgui_image;
500485      const bgfx::Memory* fs_imgui_image;
501486      const bgfx::Memory* fs_imgui_image_swizz;
r244545r244546
509494         fs_imgui_texture     = bgfx::makeRef(fs_imgui_texture_dx9, sizeof(fs_imgui_texture_dx9) );
510495         vs_imgui_cubemap     = bgfx::makeRef(vs_imgui_cubemap_dx9, sizeof(vs_imgui_cubemap_dx9) );
511496         fs_imgui_cubemap     = bgfx::makeRef(fs_imgui_cubemap_dx9, sizeof(fs_imgui_cubemap_dx9) );
512         vs_imgui_latlong     = bgfx::makeRef(vs_imgui_latlong_dx9, sizeof(vs_imgui_latlong_dx9) );
513         fs_imgui_latlong     = bgfx::makeRef(fs_imgui_latlong_dx9, sizeof(fs_imgui_latlong_dx9) );
514497         vs_imgui_image       = bgfx::makeRef(vs_imgui_image_dx9, sizeof(vs_imgui_image_dx9) );
515498         fs_imgui_image       = bgfx::makeRef(fs_imgui_image_dx9, sizeof(fs_imgui_image_dx9) );
516499         fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx9, sizeof(fs_imgui_image_swizz_dx9) );
r244545r244546
518501         break;
519502
520503      case bgfx::RendererType::Direct3D11:
521      case bgfx::RendererType::Direct3D12:
522504         vs_imgui_color       = bgfx::makeRef(vs_imgui_color_dx11, sizeof(vs_imgui_color_dx11) );
523505         fs_imgui_color       = bgfx::makeRef(fs_imgui_color_dx11, sizeof(fs_imgui_color_dx11) );
524506         vs_imgui_texture     = bgfx::makeRef(vs_imgui_texture_dx11, sizeof(vs_imgui_texture_dx11) );
525507         fs_imgui_texture     = bgfx::makeRef(fs_imgui_texture_dx11, sizeof(fs_imgui_texture_dx11) );
526508         vs_imgui_cubemap     = bgfx::makeRef(vs_imgui_cubemap_dx11, sizeof(vs_imgui_cubemap_dx11) );
527509         fs_imgui_cubemap     = bgfx::makeRef(fs_imgui_cubemap_dx11, sizeof(fs_imgui_cubemap_dx11) );
528         vs_imgui_latlong     = bgfx::makeRef(vs_imgui_latlong_dx11, sizeof(vs_imgui_latlong_dx11) );
529         fs_imgui_latlong     = bgfx::makeRef(fs_imgui_latlong_dx11, sizeof(fs_imgui_latlong_dx11) );
530510         vs_imgui_image       = bgfx::makeRef(vs_imgui_image_dx11, sizeof(vs_imgui_image_dx11) );
531511         fs_imgui_image       = bgfx::makeRef(fs_imgui_image_dx11, sizeof(fs_imgui_image_dx11) );
532512         fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx11, sizeof(fs_imgui_image_swizz_dx11) );
r244545r244546
539519         fs_imgui_texture     = bgfx::makeRef(fs_imgui_texture_glsl, sizeof(fs_imgui_texture_glsl) );
540520         vs_imgui_cubemap     = bgfx::makeRef(vs_imgui_cubemap_glsl, sizeof(vs_imgui_cubemap_glsl) );
541521         fs_imgui_cubemap     = bgfx::makeRef(fs_imgui_cubemap_glsl, sizeof(fs_imgui_cubemap_glsl) );
542         vs_imgui_latlong     = bgfx::makeRef(vs_imgui_latlong_glsl, sizeof(vs_imgui_latlong_glsl) );
543         fs_imgui_latlong     = bgfx::makeRef(fs_imgui_latlong_glsl, sizeof(fs_imgui_latlong_glsl) );
544522         vs_imgui_image       = bgfx::makeRef(vs_imgui_image_glsl, sizeof(vs_imgui_image_glsl) );
545523         fs_imgui_image       = bgfx::makeRef(fs_imgui_image_glsl, sizeof(fs_imgui_image_glsl) );
546524         fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_glsl, sizeof(fs_imgui_image_swizz_glsl) );
r244545r244546
568546      bgfx::destroyShader(vsh);
569547      bgfx::destroyShader(fsh);
570548
571      vsh = bgfx::createShader(vs_imgui_latlong);
572      fsh = bgfx::createShader(fs_imgui_latlong);
573      m_latlongProgram = bgfx::createProgram(vsh, fsh);
574      bgfx::destroyShader(vsh);
575      bgfx::destroyShader(fsh);
576
577549      vsh = bgfx::createShader(vs_imgui_image);
578550      fsh = bgfx::createShader(fs_imgui_image);
579551      m_imageProgram = bgfx::createProgram(vsh, fsh);
r244545r244546
614586      bgfx::destroyProgram(m_colorProgram);
615587      bgfx::destroyProgram(m_textureProgram);
616588      bgfx::destroyProgram(m_cubeMapProgram);
617      bgfx::destroyProgram(m_latlongProgram);
618589      bgfx::destroyProgram(m_imageProgram);
619590      bgfx::destroyProgram(m_imageSwizzProgram);
620591      nvgDelete(m_nvg);
r244545r244546
16231594      const int32_t yy = area.m_widgetY;
16241595      area.m_widgetY += _height + DEFAULT_SPACING;
16251596
1626      if (screenQuad(xx, yy, _width, _height, _originBottomLeft) )
1627      {
1628         const bool enabled = _enabled && isEnabled(m_areaId);
1629         const bool over = enabled && inRect(xx, yy, _width, _height);
1630         const bool res = buttonLogic(id, over);
1597      const bool enabled = _enabled && isEnabled(m_areaId);
1598      const bool over = enabled && inRect(xx, yy, _width, _height);
1599      const bool res = buttonLogic(id, over);
16311600
1632         const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
1633         bgfx::setUniform(u_imageLodEnabled, lodEnabled);
1634         bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
1635         bgfx::setState(BGFX_STATE_RGB_WRITE
1636                     |BGFX_STATE_ALPHA_WRITE
1637                     |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
1638                    );
1639         bgfx::setProgram(m_imageProgram);
1640         setCurrentScissor();
1641         bgfx::submit(m_view);
1601      const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
16421602
1643         return res;
1644      }
1603      screenQuad(xx, yy, _width, _height, _originBottomLeft);
1604      bgfx::setUniform(u_imageLodEnabled, lodEnabled);
1605      bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
1606      bgfx::setState(BGFX_STATE_RGB_WRITE
1607                 |BGFX_STATE_ALPHA_WRITE
1608                 |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
1609                 );
1610      bgfx::setProgram(m_imageProgram);
1611      setCurrentScissor();
1612      bgfx::submit(m_view);
16451613
1646      return false;
1614      return res;
16471615   }
16481616
16491617   bool image(bgfx::TextureHandle _image, float _lod, float _width, float _aspect, ImguiAlign::Enum _align, bool _enabled, bool _originBottomLeft)
r244545r244546
16861654      const int32_t yy = area.m_widgetY;
16871655      area.m_widgetY += _height + DEFAULT_SPACING;
16881656
1689      if (screenQuad(xx, yy, _width, _height) )
1690      {
1691         const bool enabled = _enabled && isEnabled(m_areaId);
1692         const bool over = enabled && inRect(xx, yy, _width, _height);
1693         const bool res = buttonLogic(id, over);
1657      const bool enabled = _enabled && isEnabled(m_areaId);
1658      const bool over = enabled && inRect(xx, yy, _width, _height);
1659      const bool res = buttonLogic(id, over);
16941660
1695         const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
1696         bgfx::setUniform(u_imageLodEnabled, lodEnabled);
1661      screenQuad(xx, yy, _width, _height);
16971662
1698         float swizz[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
1699         swizz[_channel] = 1.0f;
1700         bgfx::setUniform(u_imageSwizzle, swizz);
1663      const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
1664      bgfx::setUniform(u_imageLodEnabled, lodEnabled);
17011665
1702         bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
1703         bgfx::setState(BGFX_STATE_RGB_WRITE
1704                    |BGFX_STATE_ALPHA_WRITE
1705                    |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
1706                    );
1707         bgfx::setProgram(m_imageSwizzProgram);
1708         setCurrentScissor();
1709         bgfx::submit(m_view);
1666      float swizz[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
1667      swizz[_channel] = 1.0f;
1668      bgfx::setUniform(u_imageSwizzle, swizz);
17101669
1711         return res;
1712      }
1670      bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
1671      bgfx::setState(BGFX_STATE_RGB_WRITE
1672                 |BGFX_STATE_ALPHA_WRITE
1673                 |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
1674                 );
1675      bgfx::setProgram(m_imageSwizzProgram);
1676      setCurrentScissor();
1677      bgfx::submit(m_view);
17131678
1714      return false;
1679      return res;
17151680   }
17161681
17171682   bool imageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, float _width, float _aspect, ImguiAlign::Enum _align, bool _enabled)
r244545r244546
17221687      return imageChannel(_image, _channel, _lod, int32_t(width), int32_t(height), _align, _enabled);
17231688   }
17241689
1725   bool latlong(bgfx::TextureHandle _cubemap, float _lod, ImguiAlign::Enum _align, bool _enabled)
1690   bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align, bool _enabled)
17261691   {
1727      const uint32_t id = getId();
1728
1729      Area& area = getCurrentArea();
1730      int32_t xx;
1731      int32_t width;
1732      if (ImguiAlign::Left == _align)
1733      {
1734         xx = area.m_contentX + SCROLL_AREA_PADDING;
1735         width = area.m_widgetW;
1736      }
1737      else if (ImguiAlign::LeftIndented == _align
1738          ||  ImguiAlign::Right        == _align)
1739      {
1740         xx = area.m_widgetX;
1741         width = area.m_widgetW;
1742      }
1743      else //if (ImguiAlign::Center         == _align
1744          //||  ImguiAlign::CenterIndented == _align).
1745      {
1746         xx = area.m_widgetX;
1747         width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
1748      }
1749
1750      const int32_t height = width/2;
1751      const int32_t yy = area.m_widgetY;
1752      area.m_widgetY += height + DEFAULT_SPACING;
1753
1754      if (screenQuad(xx, yy, width, height, false) )
1755      {
1756         const bool enabled = _enabled && isEnabled(m_areaId);
1757         const bool over = enabled && inRect(xx, yy, width, height);
1758         const bool res = buttonLogic(id, over);
1759
1760         const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
1761         bgfx::setUniform(u_imageLodEnabled, lodEnabled);
1762
1763         bgfx::setTexture(0, s_texColor, _cubemap);
1764         bgfx::setState(BGFX_STATE_RGB_WRITE
1765                    |BGFX_STATE_ALPHA_WRITE
1766                    |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
1767                    );
1768         bgfx::setProgram(m_latlongProgram);
1769         setCurrentScissor();
1770         bgfx::submit(m_view);
1771
1772         return res;
1773      }
1774
1775      return false;
1776   }
1777
1778   bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
1779   {
1780      const uint32_t id = getId();
1781
1782      Area& area = getCurrentArea();
1783      int32_t xx;
1784      int32_t width;
1785      if (ImguiAlign::Left == _align)
1786      {
1787         xx = area.m_contentX + SCROLL_AREA_PADDING;
1788         width = area.m_widgetW;
1789      }
1790      else if (ImguiAlign::LeftIndented == _align
1791          ||  ImguiAlign::Right        == _align)
1792      {
1793         xx = area.m_widgetX;
1794         width = area.m_widgetW;
1795      }
1796      else //if (ImguiAlign::Center         == _align
1797          //||  ImguiAlign::CenterIndented == _align).
1798      {
1799         xx = area.m_widgetX;
1800         width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
1801      }
1802
1803      const bool adjustHeight = (_cross && _sameHeight);
1804      const bool fullHeight   = (_cross && !_sameHeight);
1805
1806      if (adjustHeight)
1807      {
1808         xx += width/6;
1809      }
1810
1811      const int32_t height = fullHeight ? (width*3)/4 : (width/2);
1812      const int32_t yy = area.m_widgetY;
1813      area.m_widgetY += height + DEFAULT_SPACING;
1814
18151692      const uint32_t numVertices = 14;
18161693      const uint32_t numIndices  = 36;
18171694      if (bgfx::checkAvailTransientBuffers(numVertices, PosNormalVertex::ms_decl, numIndices) )
r244545r244546
18831760            indices += addQuad(indices, 10, 12, 13, 11);
18841761         }
18851762
1763         const uint32_t id = getId();
1764
1765         Area& area = getCurrentArea();
1766         int32_t xx;
1767         int32_t width;
1768         if (ImguiAlign::Left == _align)
1769         {
1770            xx = area.m_contentX + SCROLL_AREA_PADDING;
1771            width = area.m_widgetW;
1772         }
1773         else if (ImguiAlign::LeftIndented == _align
1774             ||  ImguiAlign::Right        == _align)
1775         {
1776            xx = area.m_widgetX;
1777            width = area.m_widgetW;
1778         }
1779         else //if (ImguiAlign::Center         == _align
1780             //||  ImguiAlign::CenterIndented == _align).
1781         {
1782            xx = area.m_widgetX;
1783            width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
1784         }
1785
1786         const uint32_t height = _cross ? (width*3)/4 : (width/2);
1787         const int32_t yy = area.m_widgetY;
1788         area.m_widgetY += height + DEFAULT_SPACING;
1789
18861790         const bool enabled = _enabled && isEnabled(m_areaId);
18871791         const bool over = enabled && inRect(xx, yy, width, height);
18881792         const bool res = buttonLogic(id, over);
18891793
1890         const float widthf = float(width);
1891         const float scale = adjustHeight ? (widthf+0.5f)/3.0f : (widthf*0.5f + 0.25f);
1794         const float scale = float(width/2)+0.25f;
18921795
18931796         float mtx[16];
18941797         bx::mtxSRT(mtx, scale, scale, 1.0f, 0.0f, 0.0f, 0.0f, float(xx), float(yy), 0.0f);
r244545r244546
19141817      return false;
19151818   }
19161819
1917   bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, ImguiCubemap::Enum _display, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
1918   {
1919      if (ImguiCubemap::Cross == _display
1920      ||  ImguiCubemap::Hex   == _display)
1921      {
1922         return cubeMap(_cubemap, _lod, (ImguiCubemap::Cross == _display), _sameHeight, _align, _enabled);
1923      }
1924      else //(ImguiCubemap::Latlong == _display).
1925      {
1926         return latlong(_cubemap, _lod, _align, _enabled);
1927      }
1928   }
1929
19301820   bool collapse(const char* _text, const char* _subtext, bool _checked, bool _enabled)
19311821   {
19321822      const uint32_t id = getId();
r244545r244546
27062596#endif // USE_NANOVG_FONT
27072597   }
27082598
2709   bool screenQuad(int32_t _x, int32_t _y, int32_t _width, uint32_t _height, bool _originBottomLeft = false)
2599   void screenQuad(int32_t _x, int32_t _y, int32_t _width, uint32_t _height, bool _originBottomLeft = false)
27102600   {
27112601      if (bgfx::checkAvailTransientVertexBuffer(6, PosUvVertex::ms_decl) )
27122602      {
r244545r244546
27602650         vertex[5].m_v = minv;
27612651
27622652         bgfx::setVertexBuffer(&vb);
2763
2764         return true;
27652653      }
2766
2767      return false;
27682654   }
27692655
27702656   void colorWheelWidget(float _rgb[3], bool _respectIndentation, float _size, bool _enabled)
r244545r244546
31683054   bgfx::ProgramHandle m_colorProgram;
31693055   bgfx::ProgramHandle m_textureProgram;
31703056   bgfx::ProgramHandle m_cubeMapProgram;
3171   bgfx::ProgramHandle m_latlongProgram;
31723057   bgfx::ProgramHandle m_imageProgram;
31733058   bgfx::ProgramHandle m_imageSwizzProgram;
31743059   bgfx::TextureHandle m_missingTexture;
r244545r244546
34633348   return s_imgui.imageChannel(_image, _channel, _lod, _width, _aspect, _align, _enabled);
34643349}
34653350
3466bool imguiCube(bgfx::TextureHandle _cubemap, float _lod, ImguiCubemap::Enum _display, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
3351bool imguiCube(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align, bool _enabled)
34673352{
3468   return s_imgui.cubeMap(_cubemap, _lod, _display, _sameHeight, _align, _enabled);
3353   return s_imgui.cubeMap(_cubemap, _lod, _cross, _align, _enabled);
34693354}
34703355
34713356float imguiGetTextLength(const char* _text, ImguiFontHandle _handle)
branches/kale/3rdparty/bgfx/examples/common/imgui/imgui.h
r244545r244546
9494   };
9595};
9696
97struct ImguiCubemap
98{
99   enum Enum
100   {
101      Cross,
102      Latlong,
103      Hex,
104
105      Count,
106   };
107};
108
10997struct ImguiBorder
11098{
11199   enum Enum
r244545r244546
196184bool imguiImage(bgfx::TextureHandle _image, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true, bool _originBottomLeft = false);
197185bool imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, int32_t _width, int32_t _height, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
198186bool imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
199bool imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, ImguiCubemap::Enum _display = ImguiCubemap::Cross, bool _sameHeight = false, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
187bool imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, bool _cross = true, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
200188
201189float imguiGetTextLength(const char* _text, ImguiFontHandle _handle);
202190bool imguiMouseOverArea();
branches/kale/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
r244545r244546
9999         break;
100100
101101      case bgfx::RendererType::Direct3D11:
102      case bgfx::RendererType::Direct3D12:
103102         vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11));
104103         fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11));
105104         break;
branches/kale/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
r244545r244546
1static const uint8_t vs_imgui_latlong_glsl[337] =
2{
3   0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
4   0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
5   0x2c, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ,...attribute hi
6   0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ghp vec3 a_posit
7   0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, // ion;.attribute h
8   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 a_texc
9   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // oord0;.varying h
10   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
11   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
12   0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // ighp mat4 u_mode
13   0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void
14   0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // main ().{.  high
15   0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // p vec4 tmpvar_1;
16   0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // .  tmpvar_1.w =
17   0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // 1.0;.  tmpvar_1.
18   0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // xyz = a_position
19   0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;.  gl_Position
20   0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // = (u_modelViewPr
21   0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, // oj * tmpvar_1);.
22   0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, //   v_texcoord0 =
23   0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // a_texcoord0;.}..
24   0x00,                                                                                           // .
25};
26static const uint8_t vs_imgui_latlong_dx9[319] =
27{
28   0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
29   0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
30   0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
31   0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
32   0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
33   0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
34   0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, // modelViewProj...
35   0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
36   0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
37   0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
38   0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
39   0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
40   0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
41   0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
42   0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ................
43   0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U...........
44   0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
45   0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
46   0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
47   0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00,       // ...............
48};
49static const uint8_t vs_imgui_latlong_dx11[518] =
50{
51   0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
52   0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0xe0, 0x09, 0x04, 0x00, // elViewProj......
53   0xdc, 0x01, 0x44, 0x58, 0x42, 0x43, 0xb0, 0x50, 0xdf, 0x0d, 0x1e, 0x85, 0x4e, 0xbe, 0xdd, 0xef, // ..DXBC.P....N...
54   0x92, 0x24, 0x45, 0x46, 0x54, 0x49, 0x01, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x03, 0x00, // .$EFTI..........
55   0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
56   0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8.
57   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
58   0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......A.........
59   0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, // ..............PO
60   0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, // SITION.TEXCOORD.
61   0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGNP.........
62   0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // ..8.............
63   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........D.....
64   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0c, // ................
65   0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, // ..SV_POSITION.TE
66   0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xfc, 0x00, // XCOORD....SHDR..
67   0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..@...?...Y...F.
68   0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, //  ........._...r.
69   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, // ......_...2.....
70   0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........
71   0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...2 ......h.
72   0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8.........
73   0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ...
74   0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
75   0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ...........
76   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2.
77   0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
78   0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
79   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ........... ....
80   0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
81   0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, // ......6...2 ....
82   0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>.....
83   0x01, 0x00, 0x10, 0x00, 0x30, 0x0a,                                                             // ....0.
84};
branches/kale/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.sc
r244545r244546
1$input a_position, a_texcoord0
2$output v_texcoord0
3
4/*
5 * Copyright 2015 Dario Manesku. All rights reserved.
6 * License: http://www.opensource.org/licenses/BSD-2-Clause
7 */
8
9#include <bgfx_shader.sh>
10
11void main()
12{
13   gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
14   v_texcoord0 = a_texcoord0;
15}
branches/kale/3rdparty/bgfx/examples/common/nanovg/fontstash.h
r244545r244546
428428   void* errorUptr;
429429};
430430
431#if 0
432431static void* fons__tmpalloc(size_t size, void* up)
433432{
434433   unsigned char* ptr;
r244545r244546
454453   // empty
455454}
456455
457#endif
458456// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
459457// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
460458
branches/kale/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
r244545r244546
239239         break;
240240
241241      case bgfx::RendererType::Direct3D11:
242      case bgfx::RendererType::Direct3D12:
243242         vs_nanovg_fill = bgfx::makeRef(vs_nanovg_fill_dx11, sizeof(vs_nanovg_fill_dx11) );
244243         fs_nanovg_fill = bgfx::makeRef(fs_nanovg_fill_dx11, sizeof(fs_nanovg_fill_dx11) );
245244         break;
branches/kale/3rdparty/bgfx/examples/common/shaderlib.sh
r244545r244546
183183   return vec4(toLinear(_rgba.xyz), _rgba.w);
184184}
185185
186vec3 toLinearAccurate(vec3 _rgb)
187{
188   vec3 lo = _rgb / 12.92;
189   vec3 hi = pow( (_rgb + 0.055) / 1.055, vec3_splat(2.4) );
190   vec3 rgb = mix(hi, lo, vec3(lessThanEqual(_rgb, vec3_splat(0.04045) ) ) );
191   return rgb;
192}
193
194vec4 toLinearAccurate(vec4 _rgba)
195{
196   return vec4(toLinearAccurate(_rgba.xyz), _rgba.w);
197}
198
199186float toGamma(float _r)
200187{
201188   return pow(abs(_r), 1.0/2.2);
r244545r244546
211198   return vec4(toGamma(_rgba.xyz), _rgba.w);
212199}
213200
214vec3 toGammaAccurate(vec3 _rgb)
215{
216   vec3 lo  = _rgb * 12.92;
217   vec3 hi  = pow(abs(_rgb), vec3_splat(1.0/2.4) ) * 1.055 - 0.055;
218   vec3 rgb = mix(hi, lo, vec3(lessThanEqual(_rgb, vec3_splat(0.0031308) ) ) );
219   return rgb;
220}
221
222vec4 toGammaAccurate(vec4 _rgba)
223{
224   return vec4(toGammaAccurate(_rgba.xyz), _rgba.w);
225}
226
227201vec3 toReinhard(vec3 _rgb)
228202{
229203   return toGamma(_rgb/(_rgb+vec3_splat(1.0) ) );
branches/kale/3rdparty/bgfx/include/bgfx.c99.h
r244545r244546
265265    uint16_t depth;
266266    uint8_t numMips;
267267    uint8_t bitsPerPixel;
268    bool    cubeMap;
269268
270269} bgfx_texture_info_t;
271270
r244545r244546
725724 *  @param _num Number of vertices.
726725 *  @param _decl Vertex declaration.
727726 */
728BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint8_t _flags);
727BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint16_t _num, const bgfx_vertex_decl_t* _decl, uint8_t _flags);
729728
730729/**
731730 *  Create dynamic vertex buffer and initialize it.
r244545r244546
816815 *  NOTE:
817816 *    Only 16-bit index buffer is supported.
818817 */
819BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
818BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint16_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint16_t _numIndices);
820819
821820/**
822821 *  Allocate instance data buffer.
r244545r244546
871870/**
872871 *  Calculate amount of memory required for texture.
873872 */
874BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format);
873BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format);
875874
876875/**
877876 *  Create texture from memory buffer.
branches/kale/3rdparty/bgfx/include/bgfx.h
r244545r244546
4646         Null,         //!< No rendering.
4747         Direct3D9,    //!< Direct3D 9.0
4848         Direct3D11,   //!< Direct3D 11.0
49         Direct3D12,   //!< Direct3D 12.0
50         OpenGLES,     //!< OpenGL ES 2.0+
49         OpenGLES = 4, //!< OpenGL ES 2.0+
5150         OpenGL,       //!< OpenGL 2.1+
5251
5352         Count
r244545r244546
361360      uint16_t depth;             //!< Texture depth.
362361      uint8_t numMips;            //!< Number of MIP maps.
363362      uint8_t bitsPerPixel;       //!< Format bits per pixel.
364      bool    cubeMap;            //!< Texture is cubemap.
365363   };
366364
367365   ///
r244545r244546
687685   ///   When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated
688686   ///   from CPU.
689687   ///
690   DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE);
688   DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE);
691689
692690   /// Create dynamic vertex buffer and initialize it.
693691   ///
r244545r244546
766764   /// @remarks
767765   ///   Only 16-bit index buffer is supported.
768766   ///
769   bool allocTransientBuffers(TransientVertexBuffer* _tvb, const VertexDecl& _decl, uint32_t _numVertices, TransientIndexBuffer* _tib, uint32_t _numIndices);
767   bool allocTransientBuffers(TransientVertexBuffer* _tvb, const VertexDecl& _decl, uint16_t _numVertices, TransientIndexBuffer* _tib, uint16_t _numIndices);
770768
771769   /// Allocate instance data buffer.
772770   ///
r244545r244546
819817   void destroyProgram(ProgramHandle _handle);
820818
821819   /// Calculate amount of memory required for texture.
822   void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, TextureFormat::Enum _format);
820   void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, TextureFormat::Enum _format);
823821
824822   /// Create texture from memory buffer.
825823   ///
branches/kale/3rdparty/bgfx/include/bgfxplatform.h
r244545r244546
5151} // namespace bgfx
5252
5353#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_LINUX || BX_PLATFORM_RPI
54#   include <X11/Xlib.h>
5455
5556namespace bgfx
5657{
5758   ///
58   void x11SetDisplayWindow(void* _display, uint32_t _window);
59   void x11SetDisplayWindow(::Display* _display, ::Window _window);
5960
6061} // namespace bgfx
6162
branches/kale/3rdparty/bgfx/scripts/bgfx.lua
r244545r244546
1414            "BGFX_SHARED_LIB_BUILD=1",
1515         }
1616
17         configuration { "vs20* or mingw*" }
18            links {
19               "gdi32",
20               "psapi",
21            }
22
2317         configuration { "mingw*" }
2418            linkoptions {
2519               "-shared",
2620            }
21            links {
22               "gdi32",
23            }
2724
2825         configuration {}
2926      end
branches/kale/3rdparty/bgfx/src/bgfx.cpp
r244545r244546
3434      g_bgfxEaglLayer = _layer;
3535   }
3636#elif BX_PLATFORM_LINUX
37   void*    g_bgfxX11Display;
38   uint32_t g_bgfxX11Window;
37   ::Display* g_bgfxX11Display;
38   ::Window   g_bgfxX11Window;
3939
40   void x11SetDisplayWindow(void* _display, uint32_t _window)
40   void x11SetDisplayWindow(::Display* _display, ::Window _window)
4141   {
4242      g_bgfxX11Display = _display;
4343      g_bgfxX11Window  = _window;
r244545r244546
355355         break;
356356
357357      case RendererType::Direct3D11:
358      case RendererType::Direct3D12:
359358         mem = makeRef(vs_debugfont_dx11, sizeof(vs_debugfont_dx11) );
360359         break;
361360
r244545r244546
373372         break;
374373
375374      case RendererType::Direct3D11:
376      case RendererType::Direct3D12:
377375         mem = makeRef(fs_debugfont_dx11, sizeof(fs_debugfont_dx11) );
378376         break;
379377
r244545r244546
554552               fragMem[ii] = makeRef(mem[ii].data, uint32_t(mem[ii].size) );
555553            }
556554         }
557         else if (RendererType::Direct3D11 == g_caps.rendererType
558             ||  RendererType::Direct3D12 == g_caps.rendererType)
555         else if (RendererType::Direct3D11 == g_caps.rendererType)
559556         {
560557            vsh = createShader(makeRef(vs_clear_dx11, sizeof(vs_clear_dx11) ) );
561558
r244545r244546
775772      {
776773         m_key.m_depth  = 0;
777774         m_key.m_view   = _id;
778         m_key.m_seq    = s_ctx->m_seq[_id];
775         m_key.m_seq    = s_ctx->m_seq[_id] & s_ctx->m_seqMask[_id];
779776         s_ctx->m_seq[_id]++;
780777
781778         uint64_t key = m_key.encodeCompute();
r244545r244546
13941391
13951392            if (windowsVersionIs(Condition::GreaterEqual, 0x0602) )
13961393            {
1397               first  = RendererType::Direct3D12;
1394               first  = RendererType::Direct3D11 /* Direct3D12 */;
13981395               second = RendererType::Direct3D11;
13991396               if (!s_rendererCreator[second].supported)
1400               {
14011397                  second = RendererType::Direct3D9;
1402               }
14031398            }
14041399            else if (windowsVersionIs(Condition::GreaterEqual, 0x0601) )
14051400            {
r244545r244546
19311926      uint8_t num = 0;
19321927      for (uint8_t ii = 0; ii < uint8_t(RendererType::Count); ++ii)
19331928      {
1934         if ( (RendererType::Direct3D11 == ii || RendererType::Direct3D12 == ii)
1929         if (RendererType::Direct3D11 == ii
19351930         &&  windowsVersionIs(Condition::LessEqual, 0x0502) )
19361931         {
19371932            continue;
r244545r244546
21662161      s_ctx->destroyDynamicIndexBuffer(_handle);
21672162   }
21682163
2169   DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags)
2164   DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags)
21702165   {
21712166      BGFX_CHECK_MAIN_THREAD();
21722167      BX_CHECK(0 != _decl.m_stride, "Invalid VertexDecl.");
r244545r244546
22422237      return s_ctx->allocTransientVertexBuffer(_tvb, _num, _decl);
22432238   }
22442239
2245   bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexDecl& _decl, uint32_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint32_t _numIndices)
2240   bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexDecl& _decl, uint16_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint16_t _numIndices)
22462241   {
22472242      if (checkAvailTransientBuffers(_numVertices, _decl, _numIndices) )
22482243      {
r244545r244546
23142309      s_ctx->destroyProgram(_handle);
23152310   }
23162311
2317   void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, TextureFormat::Enum _format)
2312   void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, TextureFormat::Enum _format)
23182313   {
2319      const ImageBlockInfo& blockInfo = getBlockInfo(_format);
2320      const uint8_t  bpp         = blockInfo.bitsPerPixel;
2321      const uint32_t blockWidth  = blockInfo.blockWidth;
2322      const uint32_t blockHeight = blockInfo.blockHeight;
2323      const uint32_t minBlockX   = blockInfo.minBlockX;
2324      const uint32_t minBlockY   = blockInfo.minBlockY;
2325
2326      _width   = bx::uint32_max(blockWidth  * minBlockX, ( (_width  + blockWidth  - 1) / blockWidth)*blockWidth);
2327      _height  = bx::uint32_max(blockHeight * minBlockY, ( (_height + blockHeight - 1) / blockHeight)*blockHeight);
2314      _width   = bx::uint32_max(1, _width);
2315      _height  = bx::uint32_max(1, _height);
23282316      _depth   = bx::uint32_max(1, _depth);
23292317      _numMips = bx::uint32_max(1, _numMips);
23302318
23312319      uint32_t width  = _width;
23322320      uint32_t height = _height;
23332321      uint32_t depth  = _depth;
2334      uint32_t sides  = _cubeMap ? 6 : 1;
2335      uint32_t size   = 0;
23362322
2323      uint32_t bpp = getBitsPerPixel(_format);
2324      uint32_t size = 0;
2325
23372326      for (uint32_t lod = 0; lod < _numMips; ++lod)
23382327      {
2339         width  = bx::uint32_max(blockWidth  * minBlockX, ( (width  + blockWidth  - 1) / blockWidth )*blockWidth);
2340         height = bx::uint32_max(blockHeight * minBlockY, ( (height + blockHeight - 1) / blockHeight)*blockHeight);
2328         width  = bx::uint32_max(1, width);
2329         height = bx::uint32_max(1, height);
23412330         depth  = bx::uint32_max(1, depth);
23422331
2343         size += width*height*depth*bpp/8 * sides;
2332         size += width*height*depth*bpp/8;
23442333
23452334         width  >>= 1;
23462335         height >>= 1;
r244545r244546
23522341      _info.height  = _height;
23532342      _info.depth   = _depth;
23542343      _info.numMips = _numMips;
2355      _info.cubeMap = _cubeMap;
23562344      _info.storageSize  = size;
23572345      _info.bitsPerPixel = bpp;
23582346   }
r244545r244546
23742362      &&  NULL != _mem)
23752363      {
23762364         TextureInfo ti;
2377         calcTextureSize(ti, _width, _height, 1, false, _numMips, _format);
2365         calcTextureSize(ti, _width, _height, 1, _numMips, _format);
23782366         BX_CHECK(ti.storageSize == _mem->size
23792367            , "createTexture2D: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
23802368            , ti.storageSize
r244545r244546
24152403      &&  NULL != _mem)
24162404      {
24172405         TextureInfo ti;
2418         calcTextureSize(ti, _width, _height, _depth, false, _numMips, _format);
2406         calcTextureSize(ti, _width, _height, _depth, _numMips, _format);
24192407         BX_CHECK(ti.storageSize == _mem->size
24202408            , "createTexture3D: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
24212409            , ti.storageSize
r244545r244546
24552443      &&  NULL != _mem)
24562444      {
24572445         TextureInfo ti;
2458         calcTextureSize(ti, _size, _size, 1, true, _numMips, _format);
2459         BX_CHECK(ti.storageSize == _mem->size
2446         calcTextureSize(ti, _size, _size, 1, _numMips, _format);
2447         BX_CHECK(ti.storageSize*6 == _mem->size
24602448            , "createTextureCube: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
2461            , ti.storageSize
2449            , ti.storageSize*6
24622450            , _mem->size
24632451            );
24642452      }
r244545r244546
24712459      bx::write(&writer, magic);
24722460
24732461      TextureCreate tc;
2474      tc.m_flags   = _flags;
2475      tc.m_width   = _size;
2476      tc.m_height  = _size;
2477      tc.m_sides   = 6;
2478      tc.m_depth   = 0;
2462      tc.m_flags = _flags;
2463      tc.m_width = _size;
2464      tc.m_height = _size;
2465      tc.m_sides = 6;
2466      tc.m_depth = 0;
24792467      tc.m_numMips = _numMips;
2480      tc.m_format = uint8_t(_format);
2468      tc.m_format = uint8_t(_format);
24812469      tc.m_cubeMap = true;
2482      tc.m_mem     = _mem;
2470      tc.m_mem = _mem;
24832471      bx::write(&writer, tc);
24842472
24852473      return s_ctx->createTexture(mem, _flags, 0, NULL);
r244545r244546
31003088   bgfx::destroyDynamicIndexBuffer(handle.cpp);
31013089}
31023090
3103BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint8_t _flags)
3091BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint16_t _num, const bgfx_vertex_decl_t* _decl, uint8_t _flags)
31043092{
31053093   const bgfx::VertexDecl& decl = *(const bgfx::VertexDecl*)_decl;
31063094   union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle;
r244545r244546
31613149   bgfx::allocTransientVertexBuffer( (bgfx::TransientVertexBuffer*)_tvb, _num, decl);
31623150}
31633151
3164BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices)
3152BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t* _decl, uint16_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint16_t _numIndices)
31653153{
31663154   const bgfx::VertexDecl& decl = *(const bgfx::VertexDecl*)_decl;
31673155   return bgfx::allocTransientBuffers( (bgfx::TransientVertexBuffer*)_tvb, decl, _numVertices, (bgfx::TransientIndexBuffer*)_tib, _numIndices);
r244545r244546
32063194   bgfx::destroyProgram(handle.cpp);
32073195}
32083196
3209BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format)
3197BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format)
32103198{
32113199   bgfx::TextureInfo& info = *(bgfx::TextureInfo*)_info;
3212   bgfx::calcTextureSize(info, _width, _height, _depth, _cubeMap, _numMips, bgfx::TextureFormat::Enum(_format) );
3200   bgfx::calcTextureSize(info, _width, _height, _depth, _numMips, bgfx::TextureFormat::Enum(_format) );
32133201}
32143202
32153203BGFX_C_API bgfx_texture_handle_t bgfx_create_texture(const bgfx_memory_t* _mem, uint32_t _flags, uint8_t _skip, bgfx_texture_info_t* _info)
branches/kale/3rdparty/bgfx/src/bgfx_compute.sh
r244545r244546
2020uvec2 floatBitsToUint(vec2  _x) { return asuint(_x);  }
2121uvec3 floatBitsToUint(vec3  _x) { return asuint(_x);  }
2222uvec4 floatBitsToUint(vec4  _x) { return asuint(_x);  }
23int   floatBitsToInt(float _x)  { return asint(_x);   }
24ivec2 floatBitsToInt(vec2  _x)  { return asint(_x);   }
25ivec3 floatBitsToInt(vec3  _x)  { return asint(_x);   }
26ivec4 floatBitsToInt(vec4  _x)  { return asint(_x);   }
2723
2824#define SHARED groupshared
2925
r244545r244546
4238   return _image.Load(uint3(_uv.xy, 0) );
4339}
4440
45uint imageLoad(Texture2D<uint> _image, ivec2 _uv)
46{
47   return _image.Load(uint3(_uv.xy, 0) );
48}
49
50uint imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
51{
52   return _image[_uv.xy];
53}
54
5541ivec2 imageSize(Texture2D _image)
5642{
5743   ivec2 result;
r244545r244546
5945   return result;
6046}
6147
48//vec4 imageLoad(RWTexture2D<float4> _image, ivec2 _uv)
49//{
50//   return _image[_uv];
51//}
52
6253ivec2 imageSize(RWTexture2D<float4> _image)
6354{
6455   ivec2 result;
r244545r244546
6657   return result;
6758}
6859
69ivec2 imageSize(RWTexture2D<uint> _image)
70{
71   ivec2 result;
72   _image.GetDimensions(result.x, result.y);
73   return result;
74}
75
7660void imageStore(RWTexture2D<float4> _image, ivec2 _uv, vec4 _rgba)
7761{
7862   _image[_uv] = _rgba;
7963}
8064
81void imageStore(RWTexture2D<uint> _image, ivec2 _uv, uvec4 _r)
82{
83   _image[_uv] = _r.x;
84}
85
8665#define __ATOMIC_IMPL_TYPE(_genType, _glFunc, _dxFunc) \
8766         _genType _glFunc(_genType _mem, _genType _data) \
8867         { \
branches/kale/3rdparty/bgfx/src/bgfx_p.h
r244545r244546
201201#elif BX_PLATFORM_IOS
202202   extern void* g_bgfxEaglLayer;
203203#elif BX_PLATFORM_LINUX
204   extern void*    g_bgfxX11Display;
205   extern uint32_t g_bgfxX11Window;
204   extern ::Display* g_bgfxX11Display;
205   extern ::Window   g_bgfxX11Window;
206206#elif BX_PLATFORM_OSX
207207   extern void* g_bgfxNSWindow;
208208#elif BX_PLATFORM_WINDOWS
r244545r244546
21782178         return ptr;
21792179      }
21802180
2181      BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags) )
2181      BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint16_t _num, const VertexDecl& _decl, uint8_t _flags) )
21822182      {
21832183         DynamicVertexBufferHandle handle = BGFX_INVALID_HANDLE;
21842184         uint32_t size = strideAlign16( (_num+1)*_decl.m_stride, _decl.m_stride);
r244545r244546
26812681                  , (uint16_t)imageContainer.m_width
26822682                  , (uint16_t)imageContainer.m_height
26832683                  , (uint16_t)imageContainer.m_depth
2684                  , imageContainer.m_cubeMap
26852684                  , imageContainer.m_numMips
26862685                  , TextureFormat::Enum(imageContainer.m_format)
26872686                  );
r244545r244546
26902689            {
26912690               _info->format = TextureFormat::Unknown;
26922691               _info->storageSize = 0;
2693               _info->width   = 0;
2694               _info->height  = 0;
2695               _info->depth   = 0;
2692               _info->width = 0;
2693               _info->height = 0;
2694               _info->depth = 0;
26962695               _info->numMips = 0;
26972696               _info->bitsPerPixel = 0;
2698               _info->cubeMap = false;
26992697            }
27002698         }
27012699
r244545r244546
29062904
29072905         if (0 == refs)
29082906         {
2909            for (UniformHashMap::iterator it = m_uniformHashMap.begin(), itEnd = m_uniformHashMap.end(); it != itEnd; ++it)
2910            {
2911               if (it->second.idx == _handle.idx)
2912               {
2913                  m_uniformHashMap.erase(it);
2914                  break;
2915               }
2916            }
2917
29182907            CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyUniform);
29192908            cmdbuf.write(_handle);
29202909            m_submit->free(_handle);
branches/kale/3rdparty/bgfx/src/glcontext_egl.cpp
r244545r244546
185185      ndt = GetDC(g_bgfxHwnd);
186186      nwh = g_bgfxHwnd;
187187#   elif BX_PLATFORM_LINUX
188      ndt = (EGLNativeDisplayType)g_bgfxX11Display;
189      nwh = (EGLNativeWindowType)g_bgfxX11Window;
188      ndt = g_bgfxX11Display;
189      nwh = g_bgfxX11Window;
190190#   endif // BX_PLATFORM_
191191      m_display = eglGetDisplay(ndt);
192192      BGFX_FATAL(m_display != EGL_NO_DISPLAY, Fatal::UnableToInitialize, "Failed to create display %p", m_display);
r244545r244546
254254
255255      success = eglMakeCurrent(m_display, m_surface, m_surface, m_context);
256256      BGFX_FATAL(success, Fatal::UnableToInitialize, "Failed to set context.");
257      m_current = NULL;
258257
259258      eglSwapInterval(m_display, 0);
260259
r244545r244546
312311
313312   void GlContext::swap(SwapChainGL* _swapChain)
314313   {
315      makeCurrent(_swapChain);
316
317314      if (NULL == _swapChain)
318315      {
316         eglMakeCurrent(m_display, m_surface, m_surface, m_context);
319317         eglSwapBuffers(m_display, m_surface);
320318      }
321319      else
322320      {
321         _swapChain->makeCurrent();
323322         _swapChain->swapBuffers();
324323      }
325324   }
326325
327326   void GlContext::makeCurrent(SwapChainGL* _swapChain)
328327   {
329      if (m_current != _swapChain)
328      if (NULL == _swapChain)
330329      {
331         m_current = _swapChain;
332
333         if (NULL == _swapChain)
334         {
335            eglMakeCurrent(m_display, m_surface, m_surface, m_context);
336         }
337         else
338         {
339            _swapChain->makeCurrent();
340         }
330         eglMakeCurrent(m_display, m_surface, m_surface, m_context);
341331      }
332      else
333      {
334         _swapChain->makeCurrent();
335      }
342336   }
343337
344338   void GlContext::import()
branches/kale/3rdparty/bgfx/src/glcontext_egl.h
r244545r244546
1717   struct GlContext
1818   {
1919      GlContext()
20         : m_current(NULL)
21         , m_context(NULL)
20         : m_context(NULL)
2221         , m_display(NULL)
2322         , m_surface(NULL)
2423      {
r244545r244546
4241      }
4342
4443      void* m_eglLibrary;
45      SwapChainGL* m_current;
4644      EGLConfig  m_config;
4745      EGLContext m_context;
4846      EGLDisplay m_display;
branches/kale/3rdparty/bgfx/src/glcontext_glx.cpp
r244545r244546
2929      SwapChainGL(::Window _window, XVisualInfo* _visualInfo, GLXContext _context)
3030         : m_window(_window)
3131      {
32         m_context = glXCreateContext( (::Display*)g_bgfxX11Display, _visualInfo, _context, GL_TRUE);
32         m_context = glXCreateContext(g_bgfxX11Display, _visualInfo, _context, GL_TRUE);
3333      }
3434
3535      ~SwapChainGL()
3636      {
37         glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0);
38         glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
37         glXMakeCurrent(g_bgfxX11Display, 0, 0);
38         glXDestroyContext(g_bgfxX11Display, m_context);
3939      }
4040
4141      void makeCurrent()
4242      {
43         glXMakeCurrent( (::Display*)g_bgfxX11Display, m_window, m_context);
43         glXMakeCurrent(g_bgfxX11Display, m_window, m_context);
4444      }
4545
4646      void swapBuffers()
4747      {
48         glXSwapBuffers( (::Display*)g_bgfxX11Display, m_window);
48         glXSwapBuffers(g_bgfxX11Display, m_window);
4949      }
5050
5151      Window m_window;
r244545r244546
5555   void GlContext::create(uint32_t _width, uint32_t _height)
5656   {
5757      BX_UNUSED(_width, _height);
58      XLockDisplay( (::Display*)g_bgfxX11Display);
58      XLockDisplay(g_bgfxX11Display);
5959
6060      int major, minor;
61      bool version = glXQueryVersion( (::Display*)g_bgfxX11Display, &major, &minor);
61      bool version = glXQueryVersion(g_bgfxX11Display, &major, &minor);
6262      BGFX_FATAL(version, Fatal::UnableToInitialize, "Failed to query GLX version");
6363      BGFX_FATAL( (major == 1 && minor >= 2) || major > 1
6464            , Fatal::UnableToInitialize
r244545r244546
6767            , minor
6868            );
6969
70      int32_t screen = DefaultScreen( (::Display*)g_bgfxX11Display);
70      int32_t screen = DefaultScreen(g_bgfxX11Display);
7171
72      const char* extensions = glXQueryExtensionsString( (::Display*)g_bgfxX11Display, screen);
72      const char* extensions = glXQueryExtensionsString(g_bgfxX11Display, screen);
7373      BX_TRACE("GLX extensions:");
7474      dumpExtensions(extensions);
7575
r244545r244546
9191      GLXFBConfig bestConfig = NULL;
9292
9393      int numConfigs;
94      GLXFBConfig* configs = glXChooseFBConfig( (::Display*)g_bgfxX11Display, screen, attrsGlx, &numConfigs);
94      GLXFBConfig* configs = glXChooseFBConfig(g_bgfxX11Display, screen, attrsGlx, &numConfigs);
9595
9696      BX_TRACE("glX num configs %d", numConfigs);
9797
9898      for (int ii = 0; ii < numConfigs; ++ii)
9999      {
100         m_visualInfo = glXGetVisualFromFBConfig( (::Display*)g_bgfxX11Display, configs[ii]);
100         m_visualInfo = glXGetVisualFromFBConfig(g_bgfxX11Display, configs[ii]);
101101         if (NULL != m_visualInfo)
102102         {
103103            BX_TRACE("---");
r244545r244546
105105            for (uint32_t attr = 6; attr < BX_COUNTOF(attrsGlx)-1 && attrsGlx[attr] != None; attr += 2)
106106            {
107107               int value;
108               glXGetFBConfigAttrib( (::Display*)g_bgfxX11Display, configs[ii], attrsGlx[attr], &value);
108               glXGetFBConfigAttrib(g_bgfxX11Display, configs[ii], attrsGlx[attr], &value);
109109               BX_TRACE("glX %d/%d %2d: %4x, %8x (%8x%s)"
110110                     , ii
111111                     , numConfigs
r244545r244546
141141      BGFX_FATAL(m_visualInfo, Fatal::UnableToInitialize, "Failed to find a suitable X11 display configuration.");
142142
143143      BX_TRACE("Create GL 2.1 context.");
144      m_context = glXCreateContext( (::Display*)g_bgfxX11Display, m_visualInfo, 0, GL_TRUE);
144      m_context = glXCreateContext(g_bgfxX11Display, m_visualInfo, 0, GL_TRUE);
145145      BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create GL 2.1 context.");
146146
147147#if BGFX_CONFIG_RENDERER_OPENGL >= 31
r244545r244546
158158            0,
159159         };
160160
161         GLXContext context = glXCreateContextAttribsARB( (::Display*)g_bgfxX11Display, bestConfig, 0, true, contextAttrs);
161         GLXContext context = glXCreateContextAttribsARB(g_bgfxX11Display, bestConfig, 0, true, contextAttrs);
162162
163163         if (NULL != context)
164164         {
165            glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
165            glXDestroyContext(g_bgfxX11Display, m_context);
166166            m_context = context;
167167         }
168168      }
r244545r244546
170170      BX_UNUSED(bestConfig);
171171#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
172172
173      XUnlockDisplay( (::Display*)g_bgfxX11Display);
173      XUnlockDisplay(g_bgfxX11Display);
174174
175175      import();
176176
177      glXMakeCurrent( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, m_context);
178      m_current = NULL;
177      glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
179178
180179      glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalEXT");
181180      if (NULL != glXSwapIntervalEXT)
182181      {
183182         BX_TRACE("Using glXSwapIntervalEXT.");
184         glXSwapIntervalEXT( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, 0);
183         glXSwapIntervalEXT(g_bgfxX11Display, g_bgfxX11Window, 0);
185184      }
186185      else
187186      {
r244545r244546
204203
205204      glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
206205      glClear(GL_COLOR_BUFFER_BIT);
207      glXSwapBuffers( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window);
206      glXSwapBuffers(g_bgfxX11Display, g_bgfxX11Window);
208207   }
209208
210209   void GlContext::destroy()
211210   {
212      glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0);
213      glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
211      glXMakeCurrent(g_bgfxX11Display, 0, 0);
212      glXDestroyContext(g_bgfxX11Display, m_context);
214213      XFree(m_visualInfo);
215214   }
216215
r244545r244546
220219
221220      if (NULL != glXSwapIntervalEXT)
222221      {
223         glXSwapIntervalEXT( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, interval);
222         glXSwapIntervalEXT(g_bgfxX11Display, g_bgfxX11Window, interval);
224223      }
225224      else if (NULL != glXSwapIntervalMESA)
226225      {
r244545r244546
249248
250249   void GlContext::swap(SwapChainGL* _swapChain)
251250   {
252      makeCurrent(_swapChain);
253
254251      if (NULL == _swapChain)
255252      {
256         glXSwapBuffers( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window);
253         glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
254         glXSwapBuffers(g_bgfxX11Display, g_bgfxX11Window);
257255      }
258256      else
259257      {
258         _swapChain->makeCurrent();
260259         _swapChain->swapBuffers();
261260      }
262261   }
263262
264263   void GlContext::makeCurrent(SwapChainGL* _swapChain)
265264   {
266      if (m_current != _swapChain)
265      if (NULL == _swapChain)
267266      {
268         m_current = _swapChain;
269
270         if (NULL == _swapChain)
271         {
272            glXMakeCurrent( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, m_context);
273         }
274         else
275         {
276            _swapChain->makeCurrent();
277         }
267         glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
278268      }
269      else
270      {
271         _swapChain->makeCurrent();
272      }
279273   }
280274
281275   void GlContext::import()
branches/kale/3rdparty/bgfx/src/glcontext_glx.h
r244545r244546
1818   struct GlContext
1919   {
2020      GlContext()
21         : m_current(NULL)
22         , m_context(0)
21         : m_context(0)
2322         , m_visualInfo(NULL)
2423      {
2524      }
r244545r244546
4140         return 0 != m_context;
4241      }
4342
44      SwapChainGL* m_current;
4543      GLXContext m_context;
4644      XVisualInfo* m_visualInfo;
4745   };
branches/kale/3rdparty/bgfx/src/glcontext_wgl.cpp
r244545r244546
184184
185185            int result;
186186            uint32_t numFormats = 0;
187            do
187            do
188188            {
189189               result = wglChoosePixelFormatARB(m_hdc, attrs, NULL, 1, &m_pixelFormat, &numFormats);
190190               if (0 == result
r244545r244546
259259
260260         int result = wglMakeCurrent(m_hdc, m_context);
261261         BGFX_FATAL(0 != result, Fatal::UnableToInitialize, "wglMakeCurrent failed!");
262         m_current = NULL;
263262
264263         if (NULL != wglSwapIntervalEXT)
265264         {
r244545r244546
317316      BX_DELETE(g_allocator, _swapChain);
318317   }
319318
320   void GlContext::swap(SwapChainGL* _swapChain)
319   void GlContext::makeCurrent(SwapChainGL* _swapChain)
321320   {
322      makeCurrent(_swapChain);
323
324321      if (NULL == _swapChain)
325322      {
326         if (NULL != g_bgfxHwnd)
327         {
328            SwapBuffers(m_hdc);
329         }
323         wglMakeCurrent(m_hdc, m_context);
324         GLenum err = glGetError();
325         BX_WARN(0 == err, "wglMakeCurrent failed with GL error: 0x%04x.", err); BX_UNUSED(err);
330326      }
331327      else
332328      {
333         _swapChain->swapBuffers();
329         _swapChain->makeCurrent();
334330      }
335331   }
336332
337   void GlContext::makeCurrent(SwapChainGL* _swapChain)
333   void GlContext::swap(SwapChainGL* _swapChain)
338334   {
339      if (m_current != _swapChain)
335      if (NULL == _swapChain)
340336      {
341         m_current = _swapChain;
342
343         if (NULL == _swapChain)
337         if (NULL != g_bgfxHwnd)
344338         {
345339            wglMakeCurrent(m_hdc, m_context);
346            GLenum err = glGetError();
347            BX_WARN(0 == err, "wglMakeCurrent failed with GL error: 0x%04x.", err); BX_UNUSED(err);
340            SwapBuffers(m_hdc);
348341         }
349         else
350         {
351            _swapChain->makeCurrent();
352         }
353342      }
343      else
344      {
345         _swapChain->makeCurrent();
346         _swapChain->swapBuffers();
347      }
354348   }
355349
356350   void GlContext::import()
branches/kale/3rdparty/bgfx/src/glcontext_wgl.h
r244545r244546
6161   struct GlContext
6262   {
6363      GlContext()
64         : m_current(NULL)
65         , m_opengl32dll(NULL)
64         : m_opengl32dll(NULL)
6665         , m_context(NULL)
6766         , m_hdc(NULL)
6867      {
r244545r244546
8887      int32_t m_contextAttrs[9];
8988      int m_pixelFormat;
9089      PIXELFORMATDESCRIPTOR m_pfd;
91      SwapChainGL* m_current;
9290      void* m_opengl32dll;
9391      HGLRC m_context;
9492      HDC m_hdc;
branches/kale/3rdparty/bgfx/src/glimports.h
r244545r244546
230230GL_IMPORT______(false, PFNGLBUFFERSUBDATAPROC,                     glBufferSubData);
231231GL_IMPORT______(true,  PFNGLCHECKFRAMEBUFFERSTATUSPROC,            glCheckFramebufferStatus);
232232GL_IMPORT______(false, PFNGLCLEARPROC,                             glClear);
233GL_IMPORT______(true, PFNGLCLEARBUFFERFVPROC,                     glClearBufferfv);
233GL_IMPORT______(false, PFNGLCLEARBUFFERFVPROC,                     glClearBufferfv);
234234GL_IMPORT______(false, PFNGLCLEARCOLORPROC,                        glClearColor);
235235GL_IMPORT______(false, PFNGLCLEARSTENCILPROC,                      glClearStencil);
236236GL_IMPORT______(false, PFNGLCOLORMASKPROC,                         glColorMask);
branches/kale/3rdparty/bgfx/src/image.cpp
r244545r244546
1212{
1313   static const ImageBlockInfo s_imageBlockInfo[] =
1414   {
15      //  +------------------ bits per pixel
16      //  |  +--------------- block width
17      //  |  |  +------------ block height
18      //  |  |  |   +-------- block size
19      //  |  |  |   |  +----- min blocks x
20      //  |  |  |   |  |  +-- min blocks y
21      //  |  |  |   |  |  |
22      {   4, 4, 4,  8, 1, 1 }, // BC1
23      {   8, 4, 4, 16, 1, 1 }, // BC2
24      {   8, 4, 4, 16, 1, 1 }, // BC3
25      {   4, 4, 4,  8, 1, 1 }, // BC4
26      {   8, 4, 4, 16, 1, 1 }, // BC5
27      {   8, 4, 4, 16, 1, 1 }, // BC6H
28      {   8, 4, 4, 16, 1, 1 }, // BC7
29      {   4, 4, 4,  8, 1, 1 }, // ETC1
30      {   4, 4, 4,  8, 1, 1 }, // ETC2
31      {   8, 4, 4, 16, 1, 1 }, // ETC2A
32      {   4, 4, 4,  8, 1, 1 }, // ETC2A1
33      {   2, 8, 4,  8, 2, 2 }, // PTC12
34      {   4, 4, 4,  8, 2, 2 }, // PTC14
35      {   2, 8, 4,  8, 2, 2 }, // PTC12A
36      {   4, 4, 4,  8, 2, 2 }, // PTC14A
37      {   2, 8, 4,  8, 2, 2 }, // PTC22
38      {   4, 4, 4,  8, 2, 2 }, // PTC24
39      {   0, 0, 0,  0, 1, 1 }, // Unknown
40      {   1, 8, 1,  1, 1, 1 }, // R1
41      {   8, 1, 1,  1, 1, 1 }, // R8
42      {  16, 1, 1,  2, 1, 1 }, // R16
43      {  16, 1, 1,  2, 1, 1 }, // R16F
44      {  32, 1, 1,  4, 1, 1 }, // R32
45      {  32, 1, 1,  4, 1, 1 }, // R32F
46      {  16, 1, 1,  2, 1, 1 }, // RG8
47      {  32, 1, 1,  4, 1, 1 }, // RG16
48      {  32, 1, 1,  4, 1, 1 }, // RG16F
49      {  64, 1, 1,  8, 1, 1 }, // RG32
50      {  64, 1, 1,  8, 1, 1 }, // RG32F
51      {  32, 1, 1,  4, 1, 1 }, // BGRA8
52      {  64, 1, 1,  8, 1, 1 }, // RGBA16
53      {  64, 1, 1,  8, 1, 1 }, // RGBA16F
54      { 128, 1, 1, 16, 1, 1 }, // RGBA32
55      { 128, 1, 1, 16, 1, 1 }, // RGBA32F
56      {  16, 1, 1,  2, 1, 1 }, // R5G6B5
57      {  16, 1, 1,  2, 1, 1 }, // RGBA4
58      {  16, 1, 1,  2, 1, 1 }, // RGB5A1
59      {  32, 1, 1,  4, 1, 1 }, // RGB10A2
60      {  32, 1, 1,  4, 1, 1 }, // R11G11B10F
61      {   0, 0, 0,  0, 1, 1 }, // UnknownDepth
62      {  16, 1, 1,  2, 1, 1 }, // D16
63      {  24, 1, 1,  3, 1, 1 }, // D24
64      {  32, 1, 1,  4, 1, 1 }, // D24S8
65      {  32, 1, 1,  4, 1, 1 }, // D32
66      {  16, 1, 1,  2, 1, 1 }, // D16F
67      {  24, 1, 1,  3, 1, 1 }, // D24F
68      {  32, 1, 1,  4, 1, 1 }, // D32F
69      {   8, 1, 1,  1, 1, 1 }, // D0S8
15      {   4, 4, 4,  8 }, // BC1
16      {   8, 4, 4, 16 }, // BC2
17      {   8, 4, 4, 16 }, // BC3
18      {   4, 4, 4,  8 }, // BC4
19      {   8, 4, 4, 16 }, // BC5
20      {   8, 4, 4, 16 }, // BC6H
21      {   8, 4, 4, 16 }, // BC7
22      {   4, 4, 4,  8 }, // ETC1
23      {   4, 4, 4,  8 }, // ETC2
24      {   8, 4, 4, 16 }, // ETC2A
25      {   4, 4, 4,  8 }, // ETC2A1
26      {   2, 8, 4,  8 }, // PTC12
27      {   4, 4, 4,  8 }, // PTC14
28      {   2, 8, 4,  8 }, // PTC12A
29      {   4, 4, 4,  8 }, // PTC14A
30      {   2, 8, 4,  8 }, // PTC22
31      {   4, 4, 4,  8 }, // PTC24
32      {   0, 0, 0,  0 }, // Unknown
33      {   1, 8, 1,  1 }, // R1
34      {   8, 1, 1,  1 }, // R8
35      {  16, 1, 1,  2 }, // R16
36      {  16, 1, 1,  2 }, // R16F
37      {  32, 1, 1,  4 }, // R32
38      {  32, 1, 1,  4 }, // R32F
39      {  16, 1, 1,  2 }, // RG8
40      {  32, 1, 1,  4 }, // RG16
41      {  32, 1, 1,  4 }, // RG16F
42      {  64, 1, 1,  8 }, // RG32
43      {  64, 1, 1,  8 }, // RG32F
44      {  32, 1, 1,  4 }, // BGRA8
45      {  64, 1, 1,  8 }, // RGBA16
46      {  64, 1, 1,  8 }, // RGBA16F
47      { 128, 1, 1, 16 }, // RGBA32
48      { 128, 1, 1, 16 }, // RGBA32F
49      {  16, 1, 1,  2 }, // R5G6B5
50      {  16, 1, 1,  2 }, // RGBA4
51      {  16, 1, 1,  2 }, // RGB5A1
52      {  32, 1, 1,  4 }, // RGB10A2
53      {  32, 1, 1,  4 }, // R11G11B10F
54      {   0, 0, 0,  0 }, // UnknownDepth
55      {  16, 1, 1,  2 }, // D16
56      {  24, 1, 1,  3 }, // D24
57      {  32, 1, 1,  4 }, // D24S8
58      {  32, 1, 1,  4 }, // D32
59      {  16, 1, 1,  2 }, // D16F
60      {  24, 1, 1,  3 }, // D24F
61      {  32, 1, 1,  4 }, // D32F
62      {   8, 1, 1,  1 }, // D0S8
7063   };
7164   BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) );
7265
r244545r244546
13161309   {
13171310      uint32_t m_format;
13181311      TextureFormat::Enum m_textureFormat;
1312
13191313   };
13201314
1321   static TranslateDdsFormat s_translateDdsFourccFormat[] =
1315   static TranslateDdsFormat s_translateDdsFormat[] =
13221316   {
13231317      { DDS_DXT1,                  TextureFormat::BC1     },
13241318      { DDS_DXT2,                  TextureFormat::BC2     },
r244545r244546
13821376      { DXGI_FORMAT_R10G10B10A2_UNORM,  TextureFormat::RGB10A2 },
13831377   };
13841378
1385   struct TranslateDdsPixelFormat
1386   {
1387      uint32_t m_bitCount;
1388      uint32_t m_bitmask[4];
1389      TextureFormat::Enum m_textureFormat;
1390   };
1391
1392   static TranslateDdsPixelFormat s_translateDdsPixelFormat[] =
1393   {
1394      {  8, { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R8      },
1395      { 16, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16     },
1396      { 16, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::RGBA4   },
1397      { 16, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5  },
1398      { 16, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1  },
1399      { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, TextureFormat::BGRA8   },
1400      { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8   },
1401      { 32, { 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, TextureFormat::RGB10A2 },
1402      { 32, { 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, TextureFormat::RG16    },
1403      { 32, { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R32     },
1404   };
1405
14061379   bool imageParseDds(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader)
14071380   {
14081381      uint32_t headerSize;
r244545r244546
14471420      uint32_t fourcc;
14481421      bx::read(_reader, fourcc);
14491422
1450      uint32_t bitCount;
1451      bx::read(_reader, bitCount);
1423      uint32_t rgbCount;
1424      bx::read(_reader, rgbCount);
14521425
1453      uint32_t bitmask[4];
1454      bx::read(_reader, bitmask, sizeof(bitmask) );
1426      uint32_t rbitmask;
1427      bx::read(_reader, rbitmask);
14551428
1429      uint32_t gbitmask;
1430      bx::read(_reader, gbitmask);
1431
1432      uint32_t bbitmask;
1433      bx::read(_reader, bbitmask);
1434
1435      uint32_t abitmask;
1436      bx::read(_reader, abitmask);
1437
14561438      uint32_t caps[4];
14571439      bx::read(_reader, caps);
14581440
r244545r244546
14971479
14981480      if (dxgiFormat == 0)
14991481      {
1500         if (DDPF_FOURCC == (pixelFlags & DDPF_FOURCC) )
1482         uint32_t ddsFormat = pixelFlags & DDPF_FOURCC ? fourcc : pixelFlags;
1483
1484         for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsFormat); ++ii)
15011485         {
1502            for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsFourccFormat); ++ii)
1486            if (s_translateDdsFormat[ii].m_format == ddsFormat)
15031487            {
1504               if (s_translateDdsFourccFormat[ii].m_format == fourcc)
1505               {
1506                  format = s_translateDdsFourccFormat[ii].m_textureFormat;
1507                  break;
1508               }
1488               format = s_translateDdsFormat[ii].m_textureFormat;
1489               break;
15091490            }
15101491         }
1511         else
1512         {
1513            for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsPixelFormat); ++ii)
1514            {
1515               const TranslateDdsPixelFormat& pf = s_translateDdsPixelFormat[ii];
1516               if (pf.m_bitCount   == bitCount
1517               &&  pf.m_bitmask[0] == bitmask[0]
1518               &&  pf.m_bitmask[1] == bitmask[1]
1519               &&  pf.m_bitmask[2] == bitmask[2]
1520               &&  pf.m_bitmask[3] == bitmask[3])
1521               {
1522                  format = pf.m_textureFormat;
1523                  break;
1524               }
1525            }
1526         }
15271492      }
15281493      else
15291494      {
r244545r244546
21382103      const uint32_t blockSize   = blockInfo.blockSize;
21392104      const uint32_t blockWidth  = blockInfo.blockWidth;
21402105      const uint32_t blockHeight = blockInfo.blockHeight;
2141      const uint32_t minBlockX   = blockInfo.minBlockX;
2142      const uint32_t minBlockY   = blockInfo.minBlockY;
21432106
21442107      if (UINT32_MAX == _imageContainer.m_offset)
21452108      {
r244545r244546
21642127            // skip imageSize in KTX format.
21652128            offset += _imageContainer.m_ktx ? sizeof(uint32_t) : 0;
21662129
2167            width  = bx::uint32_max(blockWidth  * minBlockX, ( (width  + blockWidth  - 1) / blockWidth )*blockWidth);
2168            height = bx::uint32_max(blockHeight * minBlockY, ( (height + blockHeight - 1) / blockHeight)*blockHeight);
2130            width  = bx::uint32_max(blockWidth,  ( (width +blockWidth -1)/blockWidth )*blockWidth);
2131            height = bx::uint32_max(blockHeight, ( (height+blockHeight-1)/blockHeight)*blockHeight);
21692132            depth  = bx::uint32_max(1, depth);
21702133
21712134            uint32_t size = width*height*depth*bpp/8;
branches/kale/3rdparty/bgfx/src/image.h
r244545r244546
4343      uint8_t blockWidth;
4444      uint8_t blockHeight;
4545      uint8_t blockSize;
46      uint8_t minBlockX;
47      uint8_t minBlockY;
4846   };
4947
5048   ///
branches/kale/3rdparty/bgfx/src/renderer_d3d11.cpp
r244545r244546
345345   static const GUID IID_IDXGIDevice2          = { 0x05008617, 0xfbfd, 0x4051, { 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9 } };
346346   static const GUID IID_IDXGIDevice3          = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } };
347347   static const GUID IID_IDXGIAdapter          = { 0x2411e7e1, 0x12ac, 0x4ccf, { 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0 } };
348   static const GUID IID_ID3D11InfoQueue       = { 0x6543dbb6, 0x1b48, 0x42f5, { 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 } };
349348
350349   static const GUID s_deviceIIDs[] =
351350   {
r244545r244546
670669         if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
671670         {
672671            ID3D11InfoQueue* infoQueue;
673            hr = m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&infoQueue);
672            hr = m_device->QueryInterface(__uuidof(ID3D11InfoQueue), (void**)&infoQueue);
674673
675674            if (SUCCEEDED(hr) )
676675            {
r244545r244546
23652364      BX_CHECK(m_dynamic, "Must be dynamic!");
23662365
23672366      D3D11_MAPPED_SUBRESOURCE mapped;
2368      BX_UNUSED(_discard);
2369      D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
2367      D3D11_MAP type = m_dynamic && ( (0 == _offset && m_size == _size) || _discard)
2368         ? D3D11_MAP_WRITE_DISCARD
2369         : D3D11_MAP_WRITE_NO_OVERWRITE
2370         ;
23702371      DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped));
23712372      memcpy((uint8_t*)mapped.pData + _offset, _data, _size);
23722373      deviceCtx->Unmap(m_ptr, 0);
branches/kale/3rdparty/bgfx/src/renderer_d3d12.cpp
r244545r244546
55
66#include "bgfx_p.h"
77
8#if BGFX_CONFIG_RENDERER_DIRECT3D12
9#   include "../../d3d12/src/renderer_d3d12.cpp"
10#else
11
128namespace bgfx
139{
1410   RendererContextI* rendererCreateD3D12()
r244545r244546
2016   {
2117   }
2218} // namespace bgfx
23
24#endif // BGFX_CONFIG_RENDERER_DIRECT3D12
branches/kale/3rdparty/bgfx/src/renderer_gl.cpp
r244545r244546
37593759                  }
37603760               }
37613761
3762               writeStringf(&writer, "precision %s float;\n"
3763                     , m_type == GL_FRAGMENT_SHADER ? "mediump" : "highp"
3764                     );
3762               writeString(&writer, "precision mediump float;\n");
37653763
37663764               bx::write(&writer, code, codeLen);
37673765               bx::write(&writer, '\0');
r244545r244546
47874785               &&  0 == draw.m_instanceDataOffset)
47884786               {
47894787                  if (programChanged
4790                  ||  baseVertex                        != draw.m_startVertex
4791                  ||  currentState.m_vertexBuffer.idx   != draw.m_vertexBuffer.idx
4792                  ||  currentState.m_indexBuffer.idx    != draw.m_indexBuffer.idx
4788                  ||  currentState.m_vertexBuffer.idx != draw.m_vertexBuffer.idx
4789                  ||  currentState.m_indexBuffer.idx != draw.m_indexBuffer.idx
4790                  ||  currentState.m_instanceDataBuffer.idx != draw.m_instanceDataBuffer.idx
47934791                  ||  currentState.m_instanceDataOffset != draw.m_instanceDataOffset
4794                  ||  currentState.m_instanceDataStride != draw.m_instanceDataStride
4795                  ||  currentState.m_instanceDataBuffer.idx != draw.m_instanceDataBuffer.idx)
4792                  ||  currentState.m_instanceDataStride != draw.m_instanceDataStride)
47964793                  {
47974794                     bx::HashMurmur2A murmur;
47984795                     murmur.begin();
branches/kale/3rdparty/bx/include/bx/macros.h
r244545r244546
6161#   if BX_COMPILER_CLANG && (BX_PLATFORM_OSX || BX_PLATFORM_IOS)
6262#      define BX_THREAD /* not supported right now */
6363#   else
64#      if (__GNUC__ == 4) && (__GNUC_MINOR__ <= 2)
65#         define BX_THREAD /* not supported right now */   
66#      else
67#         define BX_THREAD __thread
68#      endif // __GNUC__ <= 4.2
64#      define BX_THREAD __thread
6965#   endif // BX_COMPILER_CLANG
7066#   define BX_ATTRIBUTE(_x) __attribute__( (_x) )
7167#   if BX_COMPILER_MSVC_COMPATIBLE
r244545r244546
138134#   define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x)
139135#endif // BX_COMPILER_CLANG
140136
141#if BX_COMPILER_GCC && BX_COMPILER_GCC >= 40600
137#if BX_COMPILER_GCC
142138#   define BX_PRAGMA_DIAGNOSTIC_PUSH_GCC()        _Pragma("GCC diagnostic push")
143139#   define BX_PRAGMA_DIAGNOSTIC_POP_GCC()         _Pragma("GCC diagnostic pop")
144140#   define BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x)   _Pragma(BX_STRINGIZE(GCC diagnostic ignored _x) )
r244545r244546
173169#endif // BX_COMPILER_
174170
175171///
176#if BX_COMPILER_GCC && defined(__is_pod)
177#   define BX_TYPE_IS_POD(t) __is_pod(t)
178#elif BX_COMPILER_MSVC
179#   define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t))
180#else
181#   define BX_TYPE_IS_POD(t) false
182#endif
172#define BX_TYPE_IS_POD(_type) (!__is_class(_type) || __is_pod(_type) )
173
183174///
184175#define BX_CLASS_NO_DEFAULT_CTOR(_class) \
185176         private: _class()
branches/kale/3rdparty/bx/tools/bin/darwin/genie
r244545r244546
Previous 199869 Revisions Next


© 1997-2024 The MAME Team